%!PS-Adobe-2.0
%%Creator: ./title.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
168.004 202.52(Copyright  \(c\)  1992) 4 259.996 ws
61.1918 183.08(The  Board  of  Trustees  of  the  Leland  Stanford  Junior  University) 18 366.808 ws
12 /Times-Roman sf
16 108.2(Permission  to  copy  this  manual  or  any  portion  thereof  as  necessary  for  use  of) 26 412 ws
16 94.4599(this  software  is  hereby  granted  provided  this  copyright  notice  and  statement  of) 22 412 ws
16 80.7199(permission  are  included.) 4 133.649 ws
24 /Times-Bold sf
54.4 531.92(InterViews  Reference  Manual) 4 358.32 ws
148.364 504.56(Version  3.1) 2 264.356 ws
14 /Times-Italic sf
151.347 463.28(December  14,  1992) 4 261.373 ws
18 /Times-Roman sf
149.615 422(Mark  A.  Linton) 4 263.105 ws
153.611 401.96(Paul  R.  Calder) 4 259.109 ws
141.128 381.92(John  A.  Interrante) 4 271.592 ws
161.117 361.88(Steven  Tang) 2 251.603 ws
141.605 341.84(John  M.  Vlissides) 4 271.115 ws
showpage
%%Trailer
end restore
%%Pages: 1
%!PS-Adobe-2.0
%%Creator: ./cover.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
143.692 643.28(Release  Notes) 2 284.308 ws
12 /Times-Roman sf
16 614.96(The  InterViews  3.1  distribution  contains  a  README  file  and  a  single) 20 412 ws
16 601.22(subdirectory,  \252) 2 87.615 ws
10 /Times-Roman sf
87.615 601.22(iv) 2 95.395 as
12 /Times-Roman sf
95.395 601.22(\272,  that  contains  the  source  and  documentation.   InterViews  can  be) 19 412 ws
16 587.48(compiled  with  any  C++  compiler  that  accepts  the  2.0,  2.1,  or  3.0  revisions  of  the) 28 412 ws
16 573.74(language,  and  can  run  on  X11R4  or  X11R5.   You  can  specify  your  compiler  and) 27 412 ws
16 560(other  site  definitions  in  the  file  \252iv/src/config/InterViews/local.de) 12 330.293 ws
10 /Helvetica sf
330.293 560(f) 1 333.073 as
12 /Times-Roman sf
333.073 560(\272.) 2 341.401 as
26.668 545.36(The  README) 2 101.589 ws
12 /Helvetica sf
101.589 545.36(  ) 2 107.814 ws
12 /Times-Roman sf
107.814 545.36(file  describes  how  to  build  InterViews.   Under  \252iv/src\272,  the) 17 412 ws
16 531.62(directory  \252include) 2 103.73 ws
10 /Helvetica sf
103.73 531.62(\272  ) 2 110.538 ws
12 /Times-Roman sf
110.538 531.62(contains  include  directories,  \252bin\272  contains  applications  \(each) 12 412 ws
16 517.88(in  its  own  subdirectory\),  \252lib\272  contains  libraries  \(each  in  its  own  subdirectory\),) 22 412 ws
16 504.14(\252config\272  contains  configuration-specific  files,  \252man\272  contains  PostScript  or  troff) 16 412 ws
16 490.4(for  the  manual,  and  \252papers\272  contains  PostScript  for  user  tutorials.) 18 334.949 ws
37.336 475.76(The  work  at  Stanford  has  been  supported  by  Fujitsu  America,  Digital) 20 412 ws
16 462.02(Equipment  Corporation,  and  NASA  CASIS  project  under  Contract  NAGW  419,) 18 412 ws
16 448.28(and  a  grant  from  the  Charles  Lee  Powell  Foundation.   Special  thanks  to  Ira) 25 412 ws
16 434.54(Machefsky  of  Digital  and  Charles  Brauer  of  Fujitsu  America  for  their  assistance.) 22 412 ws
16 420.8(We  are  also  grateful  to  the  ever-growing  InterViews  user  community  for  its) 22 412 ws
16 407.06(encouragement  and  support.) 4 151.637 ws
26.668 392.42(Please  address  questions  or  comments  about  InterViews  to) 14 308.297 ws
48.004 372.98(Mark  Linton) 2 109 ws
48.004 358.34(linton@sgi.com) 14 124.732 as
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
52.6958 643.28(Differences  between  3.0  and  3.1) 8 375.304 ws
12 /Times-Roman sf
16 614.96(InterViews  3.1  contains  several  improvements  over  3.0.1.   WidgetKit  is  an) 19 412 ws
16 601.22(improved  implementation  of  the  Kit  class  that  was  in  3.0.1.   DialogKit  is  a  class) 27 412 ws
16 587.48(that  provides  a  file  chooser  dialog  using  WidgetKit  compoments.   LayoutKit  is  a) 23 412 ws
16 573.74(class  that  provides  convenient  operations  for  creating  layout  objects  such  as  boxes) 22 412 ws
16 560(and  glue,  replacing  the  many  independent  classes  such  as  LRBox  and  VGlue) 22 412 ws
16 546.26(in  3.0.1.   Chapter  9  of  the  reference  manual  describes  WidgetKit,  Chapter  10) 23 412 ws
16 532.52(describes  DialogKit,  and  Chapter  11  describes  LayoutKit.) 12 293.957 ws
26.668 517.88(Glyph  and  other  subclasses  of  Resource  are  no  longer  derived  as  virtual  base) 24 412 ws
16 504.14(classes.   This  change  was  made  primarily  for  efficiency  and  convenience  because) 21 412 ws
16 490.4(many  C++  compilers  do  not  generate  particularly  efficient  code  for  virtual  base) 22 412 ws
16 476.66(classes  \(especially  in  space\),  and  some  compilers  have  bugs  in  this  area.) 22 362.261 ws
26.668 462.02(The  Glyph  protocol  has  been  extended  with  an  ) 16 257.104 ws
12 /Times-Italic sf
257.104 462.02(undraw) 6 293.776 as
12 /Times-Roman sf
293.776 462.02(  operation  that  notifies  a) 8 412 ws
16 448.28(glyph  that  it  no  longer  has  an  allocation  on  the  canvas.   This  operation  is  primarily) 29 412 ws
16 434.54(for  objects  that  cache  information  or  perform  computation  when  they  are  visible.) 22 403.924 ws
26.668 419.9(A  new  monoglyph  subclass,  called  InputHandler,  replaces  the  old  Listener) 18 412 ws
16 406.16(class.   InputHandler  is  much  simpler  to  use  than  the  previous  combination  of) 23 412 ws
16 392.42(Listener  and  PointerHandler,  as  well  as  providing  limited  support  for  focus) 20 412 ws
16 378.68(management.) 11 80.32 as
26.668 364.04(The  Window  class  now  has  a  style  object  as  one  of  its  attributes.   The  style  can) 31 412 ws
16 350.3(be  set  to  defined  attributes  such  as  name  and  geometry,  as  well  as  a  \252visual\272  type) 30 412 ws
16 336.56(for  the  window.   On  systems  that  support  overlay  planes,  the  attribute  \252overlay\272) 23 412 ws
16 322.82(can  be  used  to   request   the  window  be  allocated  in  the  window  planes.) 26 353.273 ws
26.668 308.18(InterViews  3.1  also  includes  a  new  faster  implementation  of  the  Style  class  and) 24 412 ws
16 294.44(a  copy  of  the  latest  version  of  Sam  Leffler's  TIFF  library  \(v3.0\)  for  reading) 26 412 ws
16 280.7(images.   The  old  2.6  structured  graphics  library  is  no  longer  included,  though  it) 25 412 ws
16 266.96(probably  would  still  work  with  this  distribution.) 12 246.353 ws
26.668 252.32(The  documentation  has  been  reorganized  to  reflect  some  of  the  3.1  changes,  as) 24 412 ws
16 238.58(well  as  provide  a  structure  for  future  releases.   In  addition  to  the  reference  manual,) 27 412 ws
16 224.84(a  new  collection  of  example  programs  is  provided  under  iv/src/examples.) 18 367.937 ws
395.44 39.92(0-2) 3 411.436 as
showpage
%%Trailer
end restore
%%Pages: 2
%!PS-Adobe-2.0
%%Creator: ./ch1.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
16 662.72(Chapter  1) 2 119.321 ws
16 625.76(Introduction) 12 146.68 as
12 /Times-Roman sf
16 597.44(InterViews  is  a  software  system  for  window-based  applications.   Like  most  user) 21 412 ws
16 583.7(environments,  InterViews  is  ) 6 155.44 ws
12 /Times-Italic sf
155.44 583.7(object-oriented) 15 228.76 as
12 /Times-Roman sf
228.76 583.7(  in  that  components  such  as  windows,) 12 412 ws
16 569.96(buttons,  menus,  and  documents  are  active  elements  with  inherited  behavior.   The) 21 412 ws
16 556.22(name  \252InterViews\272  comes  from  the  idea  of  a  user  interface  object  presenting) 22 412 ws
16 542.48(an  ) 2 33.2522 ws
12 /Times-Italic sf
33.2522 542.48(inter) 5 55.9202 as
12 /Times-Roman sf
55.9202 542.48(active  ) 2 90.5003 ws
12 /Times-Italic sf
90.5003 542.48(view) 4 112.496 as
12 /Times-Roman sf
112.496 542.48(  of  some  data.   For  example,  a  text  editor  implements  an) 21 412 ws
16 528.74(interactive  view  of  the  contents  of  a  text  file.) 16 230.958 ws
26.668 514.1(InterViews  provides  a  set  of  classes  that  define  the  behavior  of  user  interface) 24 412 ws
16 500.36(objects.   We  distinguish  InterViews  classes  into  two  groups:   ) 18 309.983 ws
12 /Times-Italic sf
309.983 500.36(protocols) 9 355.319 as
12 /Times-Roman sf
355.319 500.36(  and  ) 4 378.945 ws
12 /Times-Italic sf
378.945 500.36(kits) 4 395.613 as
12 /Times-Roman sf
395.613 500.36(.   A) 3 412 ws
16 486.62(protocol  defines  the  set  of  operations  that  an  object  can  perform,  such  as  drawing) 26 412 ws
16 472.88(or  handling  input.   A  kit  defines  a  set  of  operations  for  creating  other  objects.   The) 30 412 ws
16 459.14(idea  of  a  kit  is  also  sometimes  referred  to  as  an  \252object  factory\272.   Using  kits  hides) 31 412 ws
16 445.4(the  details  of  object  construction  and  subclassing-instancing  tradeoffs  made  by) 18 412 ws
16 431.66(the  implementation,  as  well  as  providing  a  higher-level  organizational  structure  to) 20 412 ws
16 417.92(the  system.) 2 70.0004 ws
18 /Times-Bold sf
16 376.64(1.1) 3 38.5 as
51 376.64(Organization) 12 153.006 as
12 /Times-Roman sf
16 344.24(In  this  first  chapter,  we  define  the  basic  notation  and  classes,  as  well  as  give) 28 412 ws
16 330.5(an  overview  of  the  system  by  way  of  several  example  programs.   Chapter  2) 25 412 ws
16 316.76(defines  the  base  protocol  for  user  interface  objects,  called  ) 18 302.144 ws
12 /Times-Italic sf
302.144 316.76(Glyph) 5 331.472 as
12 /Times-Roman sf
331.472 316.76(,  which  supports) 4 412 ws
16 303.02(geometry  management,  rendering,  picking,  and  structuring  multiple  glyphs  into) 16 412 ws
16 289.28(an  aggregate.   Chapter  3  describes  the  input  event  processing  model  and  the) 23 412 ws
12 /Times-Italic sf
16 275.54(InputHandler) 12 81.328 as
12 /Times-Roman sf
81.328 275.54(  protocol.   InputHandler  is  a  descendant  of  Glyph  that  receives  input) 21 412 ws
16 261.8(events.   Chapter  4  presents  the  ) 11 165.207 ws
12 /Times-Italic sf
165.207 261.8(View) 4 189.207 as
12 /Times-Roman sf
189.207 261.8(  protocol,  which  is  derived  from  InputHandler) 12 412 ws
16 248.06(and  adds  additional  operations  for  creating  and  updating  multiple  views  of  a) 22 412 ws
16 234.32(shared  data  object.) 4 105.641 ws
26.668 219.68(Chapter  5  defines  the  ) 8 137.448 ws
12 /Times-Italic sf
137.448 219.68(Window) 6 176.784 as
12 /Times-Roman sf
176.784 219.68(  protocol  for  associating  glyphs  with  a  window) 14 412 ws
16 205.94(on  the  screen  and  communicating  with  a  window  manager.   Chapter  6  presents  the) 25 412 ws
16 192.2(basic  protocols  for  rendering  to  the  screen  or  a  printer.) 18 277.266 ws
26.668 177.56(Chapter  7  is  reserved  for  the  future  to  describe  the  ) 20 309.544 ws
12 /Times-Italic sf
309.544 177.56(FigureKit) 9 356.884 as
12 /Times-Roman sf
356.884 177.56(  class  that) 4 412 ws
16 163.82(will  create  common  2D  graphic  objects,  such  as  rectangles,  circles,  and) 20 412 ws
16 150.08(polygons.   In  traditional  graphics  terminology,  FigureKit  will  support  \252structured\272) 17 412 ws
16 136.34(graphics,  while  the  basic  rendering  protocols  described  in  Chapter  6  support) 20 412 ws
16 122.6(\252immediate-mode\272  graphics.) 2 154.636 ws
26.668 107.96(Chapter  8  defines  the  ) 8 141.702 ws
12 /Times-Italic sf
141.702 107.96(Style) 5 165.03 as
12 /Times-Roman sf
165.03 107.96(  protocol,  which  manages  a  collection  of  named) 14 412 ws
16 94.2201(attributes  with  string  values.   Chapter  9  presents  the  ) 17 275.257 ws
12 /Times-Italic sf
275.257 94.2201(WidgetKit) 9 323.929 as
12 /Times-Roman sf
323.929 94.2201(  class  for  creating) 6 412 ws
16 80.4801(common  user  interface  components  such  as  buttons,  menus,  and  scrollbars.) 18 412 ws
16 66.7401(The  precise  appearance  and  input  behavior  of  a  widget  can  be  adjusted  by  the) 26 412 ws
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 671.36(attributes  in  a  style.   Chapter  10  presents  the  ) 17 231.961 ws
12 /Times-Italic sf
231.961 671.36(DialogKit) 9 279.973 as
12 /Times-Roman sf
279.973 671.36(  class  for  building  common) 8 412 ws
16 657.62(dialogs.) 8 53.668 as
26.668 642.98(Chapter  11  defines  the  ) 8 157.194 ws
12 /Times-Italic sf
157.194 642.98(LayoutKit) 9 205.206 as
12 /Times-Roman sf
205.206 642.98(  class  for  creating  glyphs  that  control) 12 412 ws
16 629.24(formatting.   These  objects  are  based  on  the  TeX  document  preparation  system.) 21 412 ws
16 615.5(Chapter  12  describes  the  ) 8 137.308 ws
12 /Times-Italic sf
137.308 615.5(DocumentKit) 11 201.304 as
12 /Times-Roman sf
201.304 615.5(  class  for  creating  and  editing  documents.) 12 400.936 ws
26.668 600.86(Appendix  A  defines  classes  for  interfacing  to  the  underlying  operating  system.) 20 412 ws
16 587.12(These  classes  are  not  intended  to  provide  a  complete  or  standard  interface  to  the) 26 412 ws
16 573.38(operating  system,  but  merely  a  more  convenient  and  portable  set  of  protocols.) 22 389.608 ws
18 /Times-Bold sf
16 532.1(1.2) 3 38.5 as
51 532.1(Notation) 8 117.996 as
12 /Times-Italic sf
16 499.7(N.B.:   The  notation  in  this  manual  is  somewhere  between  C++  and  the  OMG) 25 412 ws
16 485.96(Interface  Definition  Language  \(IDL\).   We  expect  to  use  IDL  in  the  future.) 23 367.121 ws
12 /Times-Roman sf
16 466.52(We  use  a  syntax  similar  to  C++  to  specify  the  InterViews  classes  and  operations.) 26 412 ws
16 452.78(However,  the  specification  of  a  class  here  is  ) 16 231.527 ws
12 /Times-Italic sf
231.527 452.78(not) 3 246.863 as
12 /Times-Roman sf
246.863 452.78(  identical  to  its  C++  declaration  in) 12 412 ws
16 439.04(a  header  file.   To  make  the  distinction  clear  between  our  specification  and  C++,) 25 412 ws
16 425.3(we  use  the  keyword  \252interface'  instead  of  \252class\272.   We  assume  inheritance  is) 23 412 ws
16 411.56(always  \252public\272  in  C++  terminology.) 8 194.525 ws
26.668 396.92(All  operations  are  assumed  public;  we  do  not  list  the  protected  or  private) 24 412 ws
16 383.18(members.   We  also  do  not  list  members  that  are  implicitly  part  of  the) 25 412 ws
16 369.44(implementation.   For  example,  C++  destructors  are  normally  public  but  often) 19 412 ws
16 355.7(simply  free  storage  allocated  by  the  object.   Thus,  there  is  no  need  to  document) 27 412 ws
16 341.96(destructors  as  part  of  a  class  interface.) 12 198.942 ws
26.668 327.32(Unless  explicitly  specified  as  \252static\272,  all  operations  are  virtual  functions  in) 20 412 ws
16 313.58(C++.   In  the  case  of  an  inherited  operation,  the  choice  of  whether  or  not  to) 29 412 ws
16 299.84(provide  the  operation  may  depend  on  the  implementation.   We  therefore  do  not) 23 412 ws
16 286.1(list  inherited  operations  unless  the  subclass  extends  the  semantics  in  some  way.) 22 397.3 ws
14 /Times-Bold sf
16 259.7(1.2.1) 5 44 as
56 259.7(Names) 5 96.432 as
12 /Times-Roman sf
16 239.26(We  use  identifiers  that  begin  with  an  upper  case  letter  for  types;  we  use  lower) 28 412 ws
16 225.52(case  for  operations  and  parameters.   In  type  names  consisting  of  multiple  words,) 23 412 ws
16 211.78(we  capitalize  the  beginning  of  each  word,  as  in  FirstSecondThird.   For  operations) 23 412 ws
16 198.04(or  parameters  we  use  underscores  to  separate  words,  as  in  first_second_third.   An) 23 412 ws
16 184.3(operation  ) 2 64.3242 ws
12 /Times-Italic sf
64.3242 184.3(f  ) 2 70.6604 ws
12 /Times-Roman sf
70.6604 184.3(for  a  class  ) 6 122.309 ws
12 /Times-Italic sf
122.309 184.3(C) 1 130.313 as
12 /Times-Roman sf
130.313 184.3(  is  denoted  by  ) 8 200.31 ws
12 /Times-Italic sf
200.31 184.3(C) 1 208.314 as
12 /Times-Roman sf
208.314 184.3(::) 2 214.986 as
12 /Times-Italic sf
214.986 184.3(f) 1 218.322 as
12 /Times-Roman sf
218.322 184.3(.) 1 221.322 as
26.668 169.66(We  assume  that  some  mechanism  allows  us  to  use  whatever  names  we  wish  for) 26 412 ws
16 155.92(global  symbols;  that  is,  there  is  no  need  for  a  special  prefix  on  all  class  and) 30 412 ws
16 142.18(type  names.   Ideally,  this  capability  would  be  provided  by  the  implementation) 21 412 ws
16 128.44(language,  but  this  is  not  yet  the  case  for  C++.   Currently,  the  implementation  uses) 27 412 ws
16 114.7(#define  macros  to  prepend  the  prefix  ``iv''  to  all  class  names  and  global  type) 26 412 ws
16 100.96(names.   This  redefinition  is  hidden  from  the  programmer,  except  inasmuch  as  it) 23 412 ws
16 87.22(shows  up  during  debugging.   To  undefine  these  macros,  a  source  file  must  include) 25 412 ws
16 73.48(\252<InterViews/leave-scope.h>\272.   After  leaving  the  InterViews  scope,  InterViews) 13 412 ws
16 59.74(names  are  specified  by  \252_lib_iv\() 8 178.552 ws
12 /Times-Italic sf
178.552 59.74(name) 4 204.544 as
12 /Times-Roman sf
204.544 59.74(\)\272,  where  ) 4 255.478 ws
12 /Times-Italic sf
255.478 59.74(name) 4 281.47 as
12 /Times-Roman sf
281.47 59.74(  is  the  class  or  type  name) 12 412 ws
395.2 38.72(1-2) 3 411.196 as
showpage
%%Page: 3 3
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 671.36(defined  in  this  manual.) 6 125.993 ws
14 /Times-Bold sf
16 644.96(1.2.2) 5 44 as
56 644.96(Use  of  const) 4 127.541 ws
12 /Times-Roman sf
16 624.52(C++  allows  the  type  modifier  \252const\272  to  be  used  in  a  variety  of  different  ways.) 28 412 ws
16 610.78(For  concrete  objects  \(int,  float,  char*\),  it  refers  to  read-only  storage.   For  abstract) 25 412 ws
16 597.04(objects,  however,  storage  access  should  not  be  visible  in  an  interface.   For) 23 412 ws
16 583.3(example,  an  operation  on  a  transformation  matrix  could  be  defined  that  returns) 22 412 ws
16 569.56(whether  the  matrix  is  the  identity  or  not.   A  simple  implementation  could  compute) 25 412 ws
16 555.82(the  identity  test  and  could  be  defined  as  const  in  the  storage  sense.   However,) 27 412 ws
16 542.08(another  implementation  might  cache  the  result  of  the  test  to  avoid  the  overhead  of) 26 412 ws
16 528.34(the  test  when  the  matrix  is  not  changing.   This  second  implementation  is  not  const) 27 412 ws
16 514.6(in  the  storage  sense  because  it  modifies  the  transformation  matrix  object.) 20 366.281 ws
26.668 499.96(We  use  const  for  operations  that  do  not  change  the  ) 20 298.826 ws
12 /Times-Italic sf
298.826 499.96(behavior) 8 341.486 as
12 /Times-Roman sf
341.486 499.96(  of  an  object.) 6 412 ws
16 486.22(That  is,  an  operation  is  const  if  a  call  to  it  could  be  omitted  without  changing) 30 412 ws
16 472.48(the  effect  of  subsequent  operations  performed  on  the  object.   This  definition  is) 23 412 ws
16 458.74(consistent  with  the  notion  that  a  compiler  could  eliminate  redundant  calls  to  the) 24 412 ws
16 445(same  const  function.   The  one  important  counter-example  is  reference  counting,) 19 412 ws
16 431.26(where  incrementing  and  decrementing  the  reference  count  of  a  shared  object) 20 412 ws
16 417.52(changes  its  lifetime  \(an  operation  that  could  not  be  eliminated  by  the  compiler\)) 24 412 ws
16 403.78(but  does  not  change  its  behavior  \(the  operation  is  considered  const\).) 20 342.281 ws
26.668 389.14(Using  our  semantics  of  const,  the  transformation  matrix  identity  function) 18 412 ws
16 375.4(mentioned  above  should  be  defined  as  const.   This  approach  implies  that  an) 23 412 ws
16 361.66(implementation  may  be  forced  to  cast  the  ) 14 223.219 ws
12 /Times-Italic sf
223.219 361.66(this) 4 240.559 as
12 /Times-Roman sf
240.559 361.66(  pointer  from  const  to  non-const  to) 12 412 ws
16 347.92(avoid  a  compiler  error  message  because  C++  compilers  normally  assume  that  a) 22 412 ws
16 334.18(function  should  not  be  const  if  the  function  does  modifies  storage.) 20 333.641 ws
26.668 319.54(It  is  also  possible  \(indeed,  likely\)  that  a  function  does  not  follow  our  semantics) 26 412 ws
16 305.8(of  const  even  though  it  does  not  modify  the  object's  storage.   If  an  object  contains) 29 412 ws
16 292.06(a  pointer  to  another  object  and  an  operation  performs  a  non-const  operation  on) 24 412 ws
16 278.32(that  object,  then  the  first  operation  may  also  need  to  be  defined  as  non-const.) 26 384.94 ws
14 /Times-Bold sf
16 251.92(1.2.3) 5 44 as
56 251.92(Common  Symbols) 2 165.284 ws
12 /Times-Roman sf
16 231.48(Several  definitions  are  pervasive  throughout  the  system.   These  definitions  are) 19 412 ws
16 217.74(automatically  defined  as  a  side  effect  of  using  any  other  InterViews  classes.) 22 412 ws
16 204(The  type  ) 4 66.3086 ws
12 /Times-Italic sf
66.3086 204(boolean) 7 104.973 as
12 /Times-Roman sf
104.973 204(  is  defined  in  the  conventional  sense  of  a  language  such  as) 22 412 ws
16 190.26(Pascal,  as  are  the  constants  ) 10 157.562 ws
12 /Times-Italic sf
157.562 190.26(true) 4 176.894 as
12 /Times-Roman sf
176.894 190.26(  and  ) 4 203.792 ws
12 /Times-Italic sf
203.792 190.26(false) 5 226.46 as
12 /Times-Roman sf
226.46 190.26(.   The  constant  ) 7 304.864 ws
12 /Times-Italic sf
304.864 190.26(nil) 3 317.536 as
12 /Times-Roman sf
317.536 190.26(  is  presumed  to  be) 8 412 ws
16 176.52(type-equivalent  to  any  pointer  type  and  represents  an  invalid  pointer  value.   In) 23 412 ws
16 162.78(C++,  we  #define  nil  to  zero.) 10 151.182 ws
26.668 148.14(The  type  ) 4 75.0948 ws
12 /Times-Italic sf
75.0949 148.14(String) 6 104.435 as
12 /Times-Roman sf
104.435 148.14(  is  used  as  a  parameter  to  a  number  of  operations,  though  no) 24 412 ws
16 134.4(specific  interface  or  implementation  is  presumed.   Whereever  a  string  parameter) 19 412 ws
16 120.66(appears,  one  can  assume  that  a  C++  \252const  char*\272  type  can  also  be  passed.) 26 374.441 ws
14 /Times-Bold sf
16 94.2601(1.2.4) 5 44 as
56 94.2601(Coordinates) 11 129.108 as
12 /Times-Roman sf
16 73.8201(Many  objects  and  operations  manipulate  coordinates.  We  define  the  type  ) 20 368.987 ws
12 /Times-Italic sf
368.987 73.8201(Coord) 5 399.659 as
12 /Times-Roman sf
399.659 73.8201(  to) 2 412 ws
16 60.0801(represent  a  position  or  a  distance.  The  default  units  for  a  coordinate  are  \252printers) 26 412 ws
395.2 38.72(1-3) 3 411.196 as
showpage
%%Page: 4 4
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 671.36(points\272,  or  1/72  of  an  inch.   The  scaling  factor  can  be  customized  on  a  per-screen) 29 412 ws
16 657.62(basis.) 6 43 as
26.668 642.98(Ideally,  Coord  would  be  an  abstract  type  with  set  of  operations  and  conversions) 24 412 ws
16 629.24(to  concrete  types.   However,  current  C++  compilers  do  not  make  it  practical) 23 412 ws
16 615.5(to  define  a  Coord  class  that  is  represented  as  a  single  word.   The  current) 27 412 ws
16 601.76(implementation  therefore  defines  Coord  as  the  C++  type  \252float'.) 16 324.485 ws
26.668 587.12(For  applications  with  simple  graphics  needs,  the  use  of  floating  point) 20 412 ws
16 573.38(coordinates  is  typically  not  a  problem.   Applications  with  more  sophisticated  text) 21 412 ws
16 559.64(or  graphics  usually  need  to  manipulate  floating  point  coordinates  anyway.) 18 371.284 ws
26.668 545(The  use  of  non-pixel  units  allows  objects  to  be  resolution-independent,  but  also) 22 412 ws
16 531.26(means  that  one  cannot  rely  on  precise  output  at  low  resolutions.   Coordinates  are) 25 412 ws
16 517.52(rounded-off  to  guarantee  that  objects  that  abut  in  coordinates  will  abut  on  the) 24 412 ws
16 503.78(screen.   This  choice  means  that  a  one  point  line  might  generate  one  or  two  pixels,) 29 412 ws
16 490.04(depending  on  where  it  is  on  the  screen.   Objects  that  need  to  generate  consistent) 27 412 ws
16 476.3(pixel  sizes  can  explicitly  round  to  whole-pixel  coordinate  values  using  Canvas) 20 412 ws
16 462.56(to_pixels_coord.) 16 96.328 as
14 /Times-Bold sf
16 436.16(1.2.5) 5 44 as
56 436.16(Dimensions) 10 125.23 as
12 /Times-Roman sf
16 415.72(Many  composition  strategies  manipulate  coordinates  in  one  dimension.  To  use  a) 20 412 ws
16 401.98(single  strategy  in  any  dimension,  we  define  the  type  ) 18 276.314 ws
12 /Times-Italic sf
276.314 401.98(DimensionName  ) 2 360.159 ws
12 /Times-Roman sf
360.159 401.98(and  values) 2 412 ws
12 /Times-Italic sf
16 388.24(Dimension_X) 11 81.328 as
12 /Times-Roman sf
81.328 388.24(,  ) 2 87.5213 ws
12 /Times-Italic sf
87.5213 388.24(Dimension_Y) 11 152.189 as
12 /Times-Roman sf
152.189 388.24(,  or  ) 4 171.572 ws
12 /Times-Italic sf
171.572 388.24(Dimension_Z) 11 236.24 as
12 /Times-Roman sf
236.24 388.24(.   It  is  possible  that  other  dimensions) 13 412 ws
16 374.5(may  be  defined  in  the  future.   The  constant  ) 17 227.668 ws
12 /Times-Italic sf
227.668 374.5(Dimension_Undefined) 19 335.656 as
12 /Times-Roman sf
335.656 374.5(  is  defined  after) 6 412 ws
16 360.76(any  other  dimensions.) 4 121.661 ws
14 /Times-Bold sf
16 334.36(1.2.6) 5 44 as
56 334.36(Parameter  conventions) 2 194.026 ws
12 /Times-Roman sf
16 313.92(In  specifying  an  operation,  we  list  only  the  parameter  type  unless  there  are  several) 26 412 ws
16 300.18(parameters  to  the  operation  with  the  same  type.   In  this  case,  we  list  both  the  type) 31 412 ws
16 286.44(and  a  name  for  the  parameter  that  clarifies  what  it  is.) 20 268.938 ws
26.668 271.8(For  parameters  that  are  objects,  we  use  a  pointer  type  if  the  operation  may  store) 28 412 ws
16 258.06(a  pointer  to  the  object  with  a  lifetime  beyond  the  operation's  activation.   If  the) 27 412 ws
16 244.32(operation  will  not  store  a  pointer,  then  we  pass  a  reference  type.   Therefore,  one) 27 412 ws
16 230.58(should  never  pass  the  expression  \252&x\272  for  a  local  or  parameter  object  \252x\272.) 24 372.905 ws
14 /Times-Bold sf
16 204.18(1.2.7) 5 44 as
56 204.18(Storage  management) 2 182.364 ws
12 /Times-Roman sf
16 183.74(Because  C++  does  not  provide  garbage  collection,  it  is  necessary  to  manage) 22 412 ws
16 170(shared  objects  within  a  program.   We  make  objects  easier  to  share  by  deriving) 25 412 ws
16 156.26(from  class  Resource,  which  manages  a  reference  count.   If  we  had  garbage) 23 412 ws
16 142.52(collection,  we  would  not  need  the  resource  class.   Therefore,  we  do  not  consider) 25 412 ws
16 128.78(resource  really  part  of  the  InterViews  programming  interface  and  it  does  not) 22 412 ws
16 115.04(appear  in  any  function  type  signatures.  However,  it  is  necessary  to  understand) 22 412 ws
16 101.3(which  objects  can  be  shared  and  as  a  practical  matter  the  implementation  must) 24 412 ws
16 87.5601(manage  references  correctly.) 4 154.265 ws
26.668 72.9201(Figure  1.1  shows  the  Resource  class  interface.   Every  resource  has  a  reference) 23 412 ws
395.2 38.72(1-4) 3 411.196 as
showpage
%%Page: 5 5
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 531.61(count  that  is  initially  zero  and  must  be  explicitly  incremented  by  calling) 22 412 ws
16 517.87(Resource::ref.   The  reason  the  count  is  initially  zero  is  that  an  object  is  often) 27 412 ws
16 504.13(created  and  immediately  passed  as  a  parameter  to  another  object  that  stores  the) 24 412 ws
16 490.39(reference.   Since  the  receiver  must  reference  the  parameter  anyway,  it  is  confusing) 23 412 ws
16 476.65(to  force  the  creator  to  unreference  the  resource  after  passing  it.) 20 316.889 ws
16 462.01(   The  C++  delete  operator  should  not  be  used  on  resources  directly;  instead,) 25 412 ws
16 448.27(Resource::unref  or  Resource::unref_deferred  should  be  called  to  decrement  the) 16 412 ws
16 434.53(reference  count  of  an  object.   If  the  count  is  no  longer  positive,  then  the  resource's) 29 412 ws
16 420.79(cleanup  operation  will  be  called.   In  the  case  of  Resource::unref,  the  object  is) 25 412 ws
16 407.05(immediately  destroyed.   In  the  case  of  Resource::unref_deferred,  the  object  will) 19 412 ws
16 393.31(be  put  on  a  queue  of  objects  to  be  destroyed  in  order  the  next  time  Resource::flush) 30 412 ws
16 379.57(is  called.   Resource  deferral  is  useful  when  an  object  initiates  a  delete  on  one  of  its) 31 412 ws
16 365.83(ancestors  or  some  other  object  with  an  active  member  function.) 18 320.609 ws
14 /Times-Bold sf
16 339.43(1.2.8) 5 44 as
56 339.43(Callbacks) 9 115.122 as
12 /Times-Roman sf
16 318.99(C++  provides  a  pointer-to-function  type,  but  often  one  wishes  to  encapsulate  an) 22 412 ws
16 305.25(object  and  a  pointer  to  a  member  function  to  call  on  the  object.   Our  approach  is) 31 412 ws
16 291.51(to  define  a  base  class  containing  the  callback  signature  and  a  parameterized) 22 412 ws
16 277.77(subclass  for  a  callback  to  an  object  of  a  specific  type.   For  example,  the  ) 29 382 ws
12 /Times-Italic sf
382 277.77(action) 6 412 as
12 /Times-Roman sf
16 264.03(class  defines  a  single  operation,  Action::execute,  with  no  parameters  and  no) 20 412 ws
16 250.29(return  value.   A  ) 7 96.779 ws
12 /Times-Italic sf
96.779 250.29(macro) 5 127.439 as
12 /Times-Roman sf
127.439 250.29(  is  an  action  that  contains  a  list  of  actions,  each  of  which) 24 412 ws
16 236.55(is  executed  in  order.   An  ) 11 149.009 ws
12 /Times-Italic sf
149.009 236.55(action  callback) 2 225.127 ws
12 /Times-Roman sf
225.127 236.55(  is  the  subclass  that  is  expanded  for) 14 412 ws
16 222.81(each  destination  type.   The  current  implementation  uses  preprocessor  macros,) 17 412 ws
16 209.07(but  will  use  templates  in  the  future.   Figure  1.2  shows  the  action,  macro,  and) 27 412 ws
16 195.33(action-callback  class  interfaces.) 4 168.281 ws
18 /Times-Bold sf
16 154.05(1.3) 3 38.5 as
51 154.05(Basic  concepts) 2 162.492 ws
12 /Times-Roman sf
16 121.65(The  goal  of  InterViews  is  to  make  it  easy  to  compose  user  interfaces  from) 26 412 ws
16 107.91(reusable  components.   The  central  class  for  physical  composition  is  Glyph  because) 21 412 ws
16 94.17(it  defines  the  geometry  of  a  user  interface  object.   The  central  class  for  logical) 27 412 ws
16 80.43(composition  is  InputHandler  because  it  defines  the  input  handling  policy  and) 20 412 ws
16 66.69(update  management.   InputHandler  is  a  subclass  of  glyph,  normally  delegating  its) 21 412 ws
395.2 38.72(1-5) 3 411.196 as
newpath
14.08 663.34 moveto
14.08 664.34 lineto
410.08 664.34 lineto
410.08 663.34 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
35.416 646.78(interface  Resource  {) 4 125.457 ws
43.746 635.26(static  void  ref\(const  Resource*\);) 6 185.457 ws
43.746 623.74(static  void  unref\(const  Resource*\);) 6 196.577 ws
43.746 612.22(static  void  unref_deferred\(const  Resource*\);) 6 239.376 ws
43.746 600.7(static  void  flush\(\);) 4 121.547 ws
43.746 589.18(void  cleanup\(\);) 2 109.326 ws
35.416 577.66(};  ) 2 44.3164 ws
10 /Helvetica sf
132.611 561.14(Figure  1.1:) 2 180.411 ws
188.741 561.14(Resource  class  interface) 4 298.221 ws
newpath
14.08 552.97 moveto
14.08 553.97 lineto
410.08 553.97 lineto
410.08 552.97 lineto
closepath
gsave eofill grestore
showpage
%%Page: 6 6
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 429.49(geometry  and  appearance  to  another  glyph.) 10 223.277 ws
26.668 414.85(The  Canvas  class  defines  a  2-dimensional  surface  upon  to  which  a  group  of) 24 412 ws
16 401.11(glyphs  are  attached.   The  glyphs  negotiate  for  space  on  the  canvas,  draw  on  the) 27 412 ws
16 387.37(canvas  to  refresh  their  appearance,  and  damage  the  canvas  to  cause  an  update) 24 412 ws
16 373.63(traversal.) 10 60.316 as
26.668 358.99(The  Window  class  creates  a  canvas  for  a  top-level  input  handler  and  allows) 24 412 ws
16 345.25(the  user  to  control  the  canvas  on  a  screen  through  a  window  manager.   The) 27 412 ws
16 331.51(window  class  does  not  define  a  window  management  policy,  only  the  mechanism) 22 412 ws
16 317.77(for  communicating  appropriate  information  between  a  window  manager  and  the) 18 412 ws
16 304.03(glyphs.) 7 51.004 as
26.668 289.39(The  InterViews  input  model  is  ``top-down''.   That  is,  an  input  event  is  first) 25 412 ws
16 275.65(received  by  the  appropriate  window  as  determined  by  the  window  manager.   The) 23 412 ws
16 261.91(receiving  window  passes  the  event  to  the  root  input  handler,  which  may  pass  it) 26 412 ws
16 248.17(down  to  a  nested  input  handler.) 10 166.649 ws
14 /Times-Bold sf
16 221.77(1.3.1) 5 44 as
56 221.77(Main  event  loop) 4 152.447 ws
12 /Times-Roman sf
16 201.33(Every  application  creates  a  Session  object  to  run  an  event  dispatching  loop.) 22 412 ws
16 187.59(Sessions  initially  attach  to  the  user's  display  and  can  attach  to  additional  displays.) 24 412 ws
16 173.85(A  session  defines  a  root  Style  object  derived  from  user  customization  files  and) 24 412 ws
16 160.11(command-line  arguments.   Styles  define  named  attributes  with  string  values,) 17 412 ws
16 146.37(wildcarding  for  matching  classes  of  objects,  and  quick  access  to  common) 20 412 ws
16 132.63(attributes  such  as  fonts  and  colors.   Figure  1.3  shows  the  session  protocol.) 23 369.473 ws
26.668 117.99(The  session  is  given  an  alias  \(class  name\)  for  the  root  style,  an  array  of) 28 412 ws
16 104.25(command-line  arguments,  an  optional  argument  description,  and  optional  initial) 16 412 ws
16 90.51(style  settings.   The  root  style's  name  comes  from  the  \252-name\272  command-line) 21 412 ws
16 76.77(option  \(if  given\),  or  the  environment  variable  RESOURCE_NAME  \(if  defined\),) 18 412 ws
16 63.03(or  the  value  of  argv[0]  with  leading  path  entries  stripped.) 18 289.949 ws
395.2 38.72(1-6) 3 411.196 as
newpath
19.12 679.9 moveto
19.12 680.9 lineto
415.12 680.9 lineto
415.12 679.9 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
40.456 663.34(typedef  long  MacroIndex;) 4 152.737 ws
40.456 646.82(interface  Action  :  Resource  {) 8 166.627 ws
48.786 635.3(void  execute\(\)  =  0;) 6 131.327 ws
40.456 623.78(};) 2 46.576 as
40.456 607.26(interface  Macro  :  Action  {) 8 151.617 ws
48.786 595.74(Macro\(Action*  =  nil,  Action*  =  nil,  Action*  =  nil,  Action*  =  nil\);) 22 315.007 ws
48.786 584.22(void  prepend\(Action*\);) 2 147.716 ws
48.786 572.7(void  append\(Action*\);) 2 144.386 ws
48.786 561.18(void  insert\(MacroIndex,  Action*\);) 4 193.276 ws
48.786 549.66(void  remove\(MacroIndex\);) 2 164.926 ws
48.786 538.14(MacroIndex  count\(\)  const;) 4 164.387 ws
48.786 526.62(Action*  action\(MacroIndex\)  const;) 4 198.286 ws
40.456 515.1(};) 2 46.576 as
40.456 498.58(interface  ActionCallback\(T\)  :  Action  {) 8 202.737 ws
48.786 487.06(ActionCallback\(T\)\(T*,  void  \(T::*\)\(\)\);) 4 202.686 ws
40.456 475.54(};) 2 46.576 as
10 /Helvetica sf
114.856 459.02(Figure  1.2:) 2 162.656 ws
170.986 459.02(Action  and  related  class  interfaces.) 8 326.056 ws
newpath
19.12 450.85 moveto
19.12 451.85 lineto
415.12 451.85 lineto
415.12 450.85 lineto
closepath
gsave eofill grestore
showpage
%%Page: 7 7
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
26.668 247.85(The  option  description  is  an  array  of  structures  that  describe  command-line) 20 412 ws
16 234.11(arguments.   The  structure  contains  four  fields:  a  ) 15 258.256 ws
12 /Times-Italic sf
258.256 234.11(name) 4 284.248 as
12 /Times-Roman sf
284.248 234.11(  that  is  the  command-line) 8 412 ws
16 220.37(string,  a  ) 4 57.896 ws
12 /Times-Italic sf
57.896 220.37(path) 4 79.232 as
12 /Times-Roman sf
79.232 220.37(  specifying  a  style  attribute,  a  ) 12 224.24 ws
12 /Times-Italic sf
224.24 220.37(format) 6 256.244 as
12 /Times-Roman sf
256.244 220.37(  specifying  where  the  associated) 8 412 ws
16 206.63(value  is,  and  a  default  ) 10 126.074 ws
12 /Times-Italic sf
126.074 206.63(value) 5 152.066 as
12 /Times-Roman sf
152.066 206.63(.   Valid  formats  are  OptionPropertyNext  \(use  the  next) 15 412 ws
16 192.89(argument  as  an  attribute-value  pair\),  OptionValueNext  \(use  the  next  argument) 18 412 ws
16 179.15(as  the  value\),  OptionValueImplicit  \(use  the  default  value\),  OptionValueIsArg) 16 412 ws
16 165.41(\(use  the  agument  as  the  value\),  and  OptionValueAfter  \(use  the  remainder  of  the) 24 412 ws
16 151.67(argument  as  the  value\).   If  a  command-line  argument  is  found  that  matches  an) 25 412 ws
16 137.93(option  description,  it  will  be  interpreted  and  removed  from  argv.   The  agument) 23 412 ws
16 124.19(count  \(argc\)  will  be  set  to  the  number  of  uninterpreted  command-line  arguments.) 22 404.596 ws
26.668 109.55(In  addition  to  the  program-specified  options,  the  Session  constructor) 16 412 ws
16 95.81(automatically  matches  the  options  listed  in  Table  1.1.   The  optional  initial  style) 23 412 ws
16 82.07(settings  are  specified  by  a  nil-terminated  array  of  pairs  ) 18 292.16 ws
12 /Times-Italic sf
292.16 82.07(<s1,s2>) 7 332.696 as
12 /Times-Roman sf
332.696 82.07(,  where  ) 4 373.506 ws
12 /Times-Italic sf
373.506 82.07(s1) 2 384.174 as
12 /Times-Roman sf
384.174 82.07(  is  an) 4 412 ws
16 68.33(attribute  name  and  ) 6 109.548 ws
12 /Times-Italic sf
109.548 68.33(s2) 2 120.216 as
12 /Times-Roman sf
120.216 68.33(  is  the  value.   User  defaults  will  override  any  initial  settings,) 21 412 ws
395.2 38.72(1-7) 3 411.196 as
newpath
19.12 676.06 moveto
19.12 677.06 lineto
415.12 677.06 lineto
415.12 676.06 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
40.456 659.5(struct  PropertyData  {) 4 132.717 ws
48.786 647.98(const  char*  path;) 4 123.827 ws
48.786 636.46(const  char*  value;) 4 128.267 ws
40.456 624.94(};) 2 46.576 as
40.456 608.42(struct  OptionDesc  {) 4 126.047 ws
48.786 596.9(const  char*  name;) 4 129.377 ws
48.786 585.38(const  char*  path;) 4 123.827 ws
48.786 573.86(OptionStyle  format;) 2 134.376 ws
48.786 562.34(const  char*  value;) 4 128.267 ws
40.456 550.82(};) 2 46.576 as
40.456 534.3(interface  Session  {) 4 123.277 ws
48.786 522.78(Session\() 8 87.686 as
57.116 511.26(const  char*  name,  int&  argc,  char**  argv) 12 234.967 ws
57.116 499.74(const  OptionDesc*  =  nil,  const  PropertyData*  =  nil) 14 277.767 ws
48.786 488.22(\);) 2 54.896 as
48.786 476.7(static  Session*  instance\(\);) 4 163.827 ws
48.786 465.18(int  argc\(\)  const;) 4 117.697 ws
48.786 453.66(char**  argv\(\)  const;) 4 134.367 ws
48.786 442.14(Style*  style\(\)  const;) 4 134.367 ws
48.786 430.62(void  default_display\(Display*\);) 2 182.716 ws
48.786 419.1(Display*  default_display\(\)  const;) 4 191.056 ws
48.786 407.58(Display*  connect\(const  String&\);) 4 192.166 ws
48.786 396.06(Display*  connect\(const  char*\);) 4 182.716 ws
48.786 384.54(void  disconnect\(Display*\);) 2 163.816 ws
48.786 373.02(int  run\(\);) 2 86.0164 ws
48.786 361.5(int  run_window\(Window*\);) 2 164.366 ws
48.786 349.98(void  quit\(\);) 2 95.4664 ws
48.786 338.46(boolean  done\(\);) 2 118.826 ws
40.456 326.94(};) 2 46.576 as
10 /Helvetica sf
155.431 310.42(Figure  1.3:) 2 203.231 ws
211.561 310.42(Session  protocol) 2 285.481 ws
192.391 277.38(Figure  1.4:) 2 240.191 ws
newpath
19.12 269.21 moveto
19.12 270.21 lineto
415.12 270.21 lineto
415.12 269.21 lineto
closepath
gsave eofill grestore
showpage
%%Page: 8 8
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 292.88(and  command-line  arguments  will  override  user  defaults.  ) 14 293.285 ws
14 /Times-Bold sf
16 266.48(1.3.2) 5 44 as
56 266.48(Common  widgets) 2 159.824 ws
12 /Times-Roman sf
16 246.04(InterViews  provides  common  behavior  objects,  such  as  buttons  and  menus,  which) 20 412 ws
16 232.3(are  built  using  glyphs  and  input  handlers.   Unlike  many  other  toolkits,  InterViews) 23 412 ws
16 218.56(objects  are  cheap  enough  that  behavior  objects  are  separate  from  appearance) 20 412 ws
16 204.82(objects.   For  example,  the  button  class  is  given  a  separate  glyph  that  denotes  its) 27 412 ws
16 191.08(appearance;  the  button  only  implements  input  behavior.) 12 283.637 ws
26.668 176.44(This  approach  of  separating  input  and  output  objects  makes  the  toolkit  more) 22 412 ws
16 162.7(flexible  and  the  individual  objects  simpler,  but  it  can  make  the  task  of  constructing) 26 412 ws
16 148.96(higher-level  user  interface  objects  more  confusing.   In  particular,  it  becomes  less) 21 412 ws
16 135.22(obvious  whether  it  is  appropriate  to  subclass  or  instance  to  create  a  particular) 24 412 ws
16 121.48(component.) 10 72.328 as
26.668 106.84(InterViews  provides  a  widget  kit  object  that  encapsulates  these  decisions  in  a) 22 412 ws
16 93.1(single  programming  interface  while  allowing  various  appearances  and  behaviors.) 16 412 ws
16 79.3599(A  widget  kit  is  an  object  that  creates  common  user  interface  objects  such  as) 26 412 ws
16 65.6199(buttons,  scrollbars,  and  menus.   For  example,  a  push  button  has  button  behavior,  a) 25 412 ws
395.2 38.72(1-8) 3 411.196 as
newpath
35.08 345.56 moveto
35.08 678.68 lineto
36.08 678.68 lineto
36.08 345.56 lineto
closepath
0 0 0.0941176 setrgbcolor
gsave eofill grestore
newpath
111.4 345.56 moveto
111.4 678.68 lineto
112.4 678.68 lineto
112.4 345.56 lineto
closepath
gsave eofill grestore
newpath
384.376 345.56 moveto
384.376 678.68 lineto
385.376 678.68 lineto
385.376 345.56 lineto
closepath
gsave eofill grestore
newpath
35.08 677.68 moveto
35.08 678.68 lineto
385.376 678.68 lineto
385.376 677.68 lineto
closepath
gsave eofill grestore
newpath
35.08 663.24 moveto
35.08 664.24 lineto
385.376 664.24 lineto
385.376 663.24 lineto
closepath
gsave eofill grestore
newpath
35.08 648.8 moveto
35.08 649.8 lineto
385.376 649.8 lineto
385.376 648.8 lineto
closepath
gsave eofill grestore
newpath
35.08 634.36 moveto
35.08 635.36 lineto
385.376 635.36 lineto
385.376 634.36 lineto
closepath
gsave eofill grestore
newpath
35.08 619.92 moveto
35.08 620.92 lineto
385.376 620.92 lineto
385.376 619.92 lineto
closepath
gsave eofill grestore
newpath
35.08 605.48 moveto
35.08 606.48 lineto
385.376 606.48 lineto
385.376 605.48 lineto
closepath
gsave eofill grestore
newpath
35.08 591.04 moveto
35.08 592.04 lineto
385.376 592.04 lineto
385.376 591.04 lineto
closepath
gsave eofill grestore
newpath
35.08 576.6 moveto
35.08 577.6 lineto
385.376 577.6 lineto
385.376 576.6 lineto
closepath
gsave eofill grestore
newpath
35.08 562.16 moveto
35.08 563.16 lineto
385.376 563.16 lineto
385.376 562.16 lineto
closepath
gsave eofill grestore
newpath
35.08 547.72 moveto
35.08 548.72 lineto
385.376 548.72 lineto
385.376 547.72 lineto
closepath
gsave eofill grestore
newpath
35.08 533.28 moveto
35.08 534.28 lineto
385.376 534.28 lineto
385.376 533.28 lineto
closepath
gsave eofill grestore
newpath
35.08 518.84 moveto
35.08 519.84 lineto
385.376 519.84 lineto
385.376 518.84 lineto
closepath
gsave eofill grestore
newpath
35.08 504.4 moveto
35.08 505.4 lineto
385.376 505.4 lineto
385.376 504.4 lineto
closepath
gsave eofill grestore
newpath
35.08 489.96 moveto
35.08 490.96 lineto
385.376 490.96 lineto
385.376 489.96 lineto
closepath
gsave eofill grestore
newpath
35.08 475.52 moveto
35.08 476.52 lineto
385.376 476.52 lineto
385.376 475.52 lineto
closepath
gsave eofill grestore
newpath
35.08 461.08 moveto
35.08 462.08 lineto
385.376 462.08 lineto
385.376 461.08 lineto
closepath
gsave eofill grestore
newpath
35.08 446.64 moveto
35.08 447.64 lineto
385.376 447.64 lineto
385.376 446.64 lineto
closepath
gsave eofill grestore
newpath
35.08 432.2 moveto
35.08 433.2 lineto
385.376 433.2 lineto
385.376 432.2 lineto
closepath
gsave eofill grestore
newpath
35.08 417.76 moveto
35.08 418.76 lineto
385.376 418.76 lineto
385.376 417.76 lineto
closepath
gsave eofill grestore
newpath
35.08 403.32 moveto
35.08 404.32 lineto
385.376 404.32 lineto
385.376 403.32 lineto
closepath
gsave eofill grestore
newpath
35.08 388.88 moveto
35.08 389.88 lineto
385.376 389.88 lineto
385.376 388.88 lineto
closepath
gsave eofill grestore
newpath
35.08 374.44 moveto
35.08 375.44 lineto
385.376 375.44 lineto
385.376 374.44 lineto
closepath
gsave eofill grestore
newpath
35.08 360 moveto
35.08 361 lineto
385.376 361 lineto
385.376 360 lineto
closepath
gsave eofill grestore
newpath
35.08 345.56 moveto
35.08 346.56 lineto
385.376 346.56 lineto
385.376 345.56 lineto
closepath
gsave eofill grestore
0 0 0 setrgbcolor
40.08 667.12(-background) 11 100.728 as
116.4 667.12(next  argument  sets  the  background  color) 10 311.364 ws
40.08 652.68(-bg) 3 56.076 as
116.4 652.68(same  as  -background) 4 217.704 ws
40.08 638.24(-dbu) 4 62.076 as
10 /Times-Roman sf
62.076 638.24(f) 1 65.406 as
12 /Times-Roman sf
116.4 638.24(double-buffer  windows  by  default) 6 280.032 ws
40.08 623.8(-display) 8 78.744 as
116.4 623.8(next  argument  specifies  the  target  workstation  display) 12 375.696 ws
40.08 609.36(-dpi) 4 59.412 as
116.4 609.36(next  argument  is  coordinates-to-pixels  ratio) 8 325.704 ws
40.08 594.92(-fg) 3 54.072 as
116.4 594.92(same  as  -foreground) 4 214.368 ws
40.08 580.48(-flat) 5 60.072 as
116.4 580.48(next  argument  sets  the  base  color  for  bevels) 14 326.688 ws
40.08 566.04(-fn) 3 54.072 as
116.4 566.04(same  as  -font) 4 180.384 ws
40.08 551.6(-font) 5 63.408 as
116.4 551.6(next  argument  sets  the  default  text  font) 12 303.709 ws
40.08 537.16(-foreground) 11 97.392 as
116.4 537.16(next  argument  sets  the  foreground  color) 10 308.028 ws
40.08 522.72(-geometry) 9 89.4 as
116.4 522.72(next  argument  sets  the  first  window's  position  and  size) 16 380.376 ws
40.08 508.28(-iconic) 7 73.404 as
116.4 508.28(starts  up  first  window  in  iconic  form) 12 291.721 ws
40.08 493.84(-malloc) 7 76.74 as
116.4 493.84(run  with  memory-management  debugging  on) 8 333.708 ws
40.08 479.4(-monochrome) 11 107.4 as
116.4 479.4(use  monochrome  style) 4 224.388 ws
40.08 464.96(-motif) 6 70.08 as
116.4 464.96(use  Motif  style) 4 188.4 ws
40.08 450.52(-name) 5 70.068 as
116.4 450.52(next  argument  sets  the  instance  name  of  the  session) 16 363.696 ws
40.08 436.08(-nodbuf) 7 78.072 as
116.4 436.08(do  not  double-buffer  windows) 6 262.044 ws
40.08 421.64(-openlook) 9 88.74 as
116.4 421.64(use  OpenLook  style) 4 212.388 ws
40.08 407.2(-synchronous) 12 104.736 as
116.4 407.2(force  synchronous  operation  with  the  window  system) 12 373.032 ws
40.08 392.76(-title) 6 62.748 as
116.4 392.76(next  argument  sets  the  session's  default  title  bar  name) 16 375.696 ws
40.08 378.32(-visual) 7 72.744 as
116.4 378.32(next  argument  is  visual  class  to  use  for  windows) 16 349.044 ws
40.08 363.88(-visual_id) 10 88.08 as
116.4 363.88(next  argument  is  visual  id  number  to  use  for  windows) 18 374.712 ws
40.08 349.44(-xrm) 4 63.408 as
12 /Times-Roman sf
116.4 349.44(next  argument  is  \252name:value\272;  sets  named  attribute) 12 367.692 ws
99.2399 323.12(Table  1.1:) 2 147.9 ws
158.568 323.12(Predefined  command-line  options) 4 321.216 ws
showpage
%%Page: 9 9
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 671.36(beveled  or  highlighted  appearance  when  pressed,  and  a  style  for  customization.) 20 412 ws
16 657.62(The  WidgetKit  class  provides  a  function  to  create  a  push  button  object;  the) 24 412 ws
16 643.88(implementation  is  free  to  compose  what  objects  are  necessary  to  provide  the) 22 412 ws
16 630.14(appropriate  functionality.   Each  application  normally  creates  a  single  WidgetKit) 17 412 ws
16 616.4(object,  which  is  typically  a  subclass  defined  for  a  particular  look-and-feel) 20 412 ws
16 602.66(such  as  OpenLook  or  Motif.   The  application  can  call  the  static  function) 23 412 ws
16 588.92(WidgetKit:::instance  to  return  the  object  and  therefore  be  unaware  which  specific) 20 412 ws
16 575.18(look-and-feel  is  being  used.) 6 149.309 ws
18 /Times-Bold sf
16 533.9(1.4) 3 38.5 as
51 533.9(A  simple  example) 4 186.991 ws
12 /Times-Roman sf
16 501.5(Figure  1.5  shows  a  simple  InterViews  application  that  display  the  text  \252hi  mom!\272) 24 412 ws
16 487.76(in  a  window.   The  application  creates  a  session  and  runs  it  starting  with  a  window) 29 412 ws
16 474.02(containing  the  text  over  a  background.   The  window  is  an  \252application  window\272,) 23 412 ws
16 460.28(meaning  it  is  recognized  by  other  desktop  services  \(window  manager,  session) 20 412 ws
16 446.54(manager\)  as  the  main  window  for  the  application.) 14 254.621 ws
26.668 431.9(The  window  contains  a  background  that  contains  a  label.   A  background  glyph) 23 412 ws
16 418.16(paints  a  given  color  behind  its  contents.   The  label's  font  and  color  are  obtained) 27 412 ws
16 404.42(from  the  default  style  for  the  session.) 12 194.31 ws
26.668 389.78(This  application  does  not  handle  user  input.   It  must  therefore  be  terminated) 23 412 ws
16 376.04(externally,  either  from  a  window  manager  menu  or  through  the  system.) 20 357.941 ws
18 /Times-Bold sf
16 334.76(1.5) 3 38.5 as
51 334.76(Geometry  management) 2 231.45 ws
12 /Times-Roman sf
16 302.36(See  iv/src/examples/box[12].) 2 155.98 ws
395.2 38.72(1-9) 3 411.196 as
newpath
16.24 302.62 moveto
16.24 303.62 lineto
412.24 303.62 lineto
412.24 302.62 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.576 286.06(#include  <IV-look/kit.h>) 2 141.516 ws
37.576 274.54(#include  <InterViews/background.h>) 2 199.326 ws
37.576 263.02(#include  <InterViews/session.h>) 2 180.976 ws
37.576 251.5(#include  <InterViews/window.h>) 2 180.416 ws
37.576 234.98(int  main\(int  argc,  char**  argv\)  {) 10 173.177 ws
45.906 223.46(Session*  session  =  new  Session\("Himom",  argc,  argv\);) 12 288.357 ws
45.906 211.94(WidgetKit&  kit  =  *WidgetKit::instance\(\);) 6 218.467 ws
45.906 200.42(return  session->run_window\() 2 174.556 ws
54.236 188.9(new  ApplicationWindow\() 2 163.156 ws
62.566 177.38(new  Background\() 2 140.376 ws
70.896 165.86(kit.label\("hi  mom!"\),  kit.background\(\)) 4 231.366 ws
62.566 154.34(\)) 1 65.896 as
54.236 142.82(\)) 1 57.566 as
45.906 131.3(\);) 2 52.016 as
37.576 119.78(}) 1 40.916 as
10 /Helvetica sf
122.056 103.26(Figure  1.5:) 2 169.856 ws
178.186 103.26(InterViews  "hi  mom!"  program.) 6 313.096 ws
newpath
16.24 82.57 moveto
16.24 83.57 lineto
412.24 83.57 lineto
412.24 82.57 lineto
closepath
gsave eofill grestore
showpage
%%Page: 10 10
90.05 36.94 translate
0 0 0 setrgbcolor
18 /Times-Bold sf
16 667.52(1.6) 3 38.5 as
51 667.52(Creating  a  push  button) 6 229.525 ws
12 /Times-Roman sf
16 635.12(See  iv/src/examples/button[123].) 2 174.652 ws
18 /Times-Bold sf
16 593.84(1.7) 3 38.5 as
51 593.84(Summary) 7 126.996 as
12 /Times-Roman sf
16 561.44(This  chapter  has  presented  a  broad  overview  of  the  InterViews  architecture,) 20 412 ws
16 547.7(introducing  the  basic  concepts  and  giving  some  simple  examples.   In  the  next) 23 412 ws
16 533.96(chapter,  we  focus  on  the  semantics  of  glyphs  as  the  smallest  unit  of  user  interface) 28 412 ws
16 520.22(construction.) 13 78.328 as
395.2 38.72(1-) 2 405.196 as
402.196 38.72(10) 2 414.196 as
showpage
%%Trailer
end restore
%%Pages: 10
%!PS-Adobe-2.0
%%Creator: ./ch2.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
16 662.72(Chapter  2) 2 119.321 ws
16 625.76(Glyphs) 6 89.368 as
12 /Times-Roman sf
16 597.44(Glyphs  are  the  basic  building  blocks  for  the  presentation  side  of  a  user) 24 412 ws
16 583.7(interface,  providing  a  unified  substrate  for  interactive  objects,  structured  graphics,) 18 412 ws
16 569.96(and  formatted  text.   The  glyph  protocol  supports  geometry,  drawing,  picking,) 19 412 ws
16 556.22(composition,  and  structure.   Glyph  subclasses  provide  higher-level  operations,) 15 412 ws
16 542.48(such  as  input  handling  and  update  management.) 12 246.305 ws
26.668 527.84(The  base  class  defines  no  storage  and  operations  are  passed  contextual) 20 412 ws
16 514.1(information  during  rendering.  Thus,  glyphs  may  be  shared  and  a  glyph  structure) 22 412 ws
16 500.36(need  not  be  strictly  hierarchical;  it  may  be  a  directed  acyclic  graph.   Figure  2.1) 27 412 ws
16 486.62(shows  the  glyph  protocol.) 6 139.997 ws
18 /Times-Bold sf
16 445.34(2.1) 3 38.5 as
51 445.34(Geometry  management) 2 231.45 ws
12 /Times-Roman sf
16 412.94(Glyph::request  asks  a  glyph  to  specify  its  desired  geometry.   This  operation  should) 23 412 ws
16 399.2(be  fast  to  allow  a  composite  glyph  to  compute  rather  than  store  the  desired) 26 412 ws
16 385.46(geometry  of  its  components.   Glyph::allocate  notifies  a  glyph  that  a  portion  of  the) 25 412 ws
16 371.72(canvas  has  been  allocated  for  it  and  returns  an  area  that  represents  a  conservative) 26 412 ws
16 357.98(estimate  of  the  actual  area  where  the  glyph  will  draw.) 18 273.27 ws
18 /Times-Bold sf
16 316.7(2.2) 3 38.5 as
51 316.7(Drawing) 7 117.996 as
12 /Times-Roman sf
16 284.3(Glyph::draw  displays  the  glyph  on  the  canvas  at  the  position  and  size  specified  by) 26 412 ws
16 270.56(the  allocation.   No  clipping  or  translation  is  implicit  in  this  operation\261the  canvas  is) 25 412 ws
16 256.82(the  entire  drawing  area  and  the  allocation  is  in  canvas  coordinates.   However,  a) 25 412 ws
16 243.08(composite  glyph  may  set  clipping  on  the  canvas  before  drawing  its  children.) 22 381.952 ws
26.668 228.44(There  is  no  guarantee  that  a  call  to  draw  will  affect  the  screen  immediately) 26 412 ws
16 214.7(because  of  the  possibility  \(indeed,  likelihood\)  that  the  canvas  is  double-buffered.) 20 412 ws
16 200.96(Furthermore,  drawing  order  is  important  for  glyphs  when  they  are  partially) 20 412 ws
16 187.22(transparent  and  are  drawn  in  the  same  plane.   A  glyph's  draw  operation  therefore) 25 412 ws
16 173.48(should  not  be  called  directly,  but  rather  is  implicitly  called  during  screen  update.) 24 402.616 ws
26.668 158.84(Glyph::undraw  notifies  a  glyph  that  its  allocation  is  no  longer  valid.   This) 23 412 ws
16 145.1(operation  is  generally  a  performance  hint  to  free  cached  information  associated) 20 412 ws
16 131.36(with  drawing  or  inhibit  some  operation  that  is  unnecessary  while  the  glyph  is  not) 26 412 ws
16 117.62(visible,  such  as  cursor  blinking.   Glyph::undraw  is  ) 15 264.449 ws
12 /Times-Italic sf
264.449 117.62(not) 3 279.785 as
12 /Times-Roman sf
279.785 117.62(  to  be  used  when  a  glyph's) 12 412 ws
16 103.88(allocation  changes;  in  that  case,  allocate  and  draw  can  simply  be  called  with) 24 412 ws
16 90.14(different  parameters.) 2 115.96 ws
26.668 75.5(Glyph::print  generates  a  representation  of  the  glyph  graph  suitable  for  printing.) 20 412 ws
16 61.76(The  canvas  and  printer  rendering  interfaces  are  identical,  and  the  default) 20 412 ws
388.72 36.08(2-) 2 398.716 as
401.716 36.08(1) 1 407.716 as
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 350.17(implementation  of  print  is  simply  to  call  draw.   Most  glyphs  therefore  need  not) 25 412 ws
16 336.43(define  a  print  operation.   The  reason  for  a  distinct  print  operation  is  to  allow) 27 412 ws
16 322.69(a  glyph  to  use  different  rendering  requests  for  the  screen  and  a  printer.   For) 27 412 ws
16 308.95(example,  a  glyph  might  use  3D  requests  to  the  screen,  or  might  compute  more) 26 412 ws
16 295.21(precise  output  for  printing.) 6 144.653 ws
26.668 280.57(Glyph::pick  finds  the  glyphs  that  intersect  a  point  or  rectangle  specified) 20 412 ws
16 266.83(in  canvas-relative  coordinates.  Conceptually,  picking  is  like  drawing  and) 16 412 ws
16 253.09(determining  what  glyphs  intersect  the  specified  point  or  rectangle.   The) 19 412 ws
16 239.35(coordinates  are  contained  in  the  hit  parameter.   The  depth  parameter  specifies) 21 412 ws
16 225.61(which  level  in  the  Hit  object  to  store  the  intersecting  glyphs.   When  pick  returns,) 27 412 ws
16 211.87(the  Hit  parameter  contains  the  glyphs  that  were  hit.) 16 261.629 ws
26.668 197.23(Figure  2.2  shows  the  hit  protocol.   A  hit  object  may  be  constructed  with  a  point,) 29 412 ws
16 183.49(a  rectangle,  or  an  event.   In  the  case  of  the  event,  the  event  pointer  coordinates  are) 31 412 ws
16 169.75(used  to  detect  intersection  and  glyphs  can  associate  a  handler  with  the  pick  result.) 26 407.932 ws
26.668 155.11(Hit::event,  Hit::left,  Hit::bottom,  Hit::right,  Hit::top  return  information  about) 14 412 ws
16 141.37(the  specified  hit  area.   Hit::event  returns  nil  if  the  point  or  rectangle  constructors) 25 412 ws
16 127.63(were  used.) 2 67.3124 ws
26.668 112.99(Hit::push_transform,  Hit::transform,  and  Hit::pop_transform  modify  the  current) 12 412 ws
16 99.2499(intersection  area  for  picking.   These  operations  are  just  like  the  canvas  operations) 23 412 ws
16 85.5099(with  the  same  names  except  they  apply  to  the  hit  information  instead  of  a  canvas.) 28 406.276 ws
26.668 70.8699(Glyphs  record  information  in  a  hit  object  with  Hit::begin,  Hit::target  and) 20 412 ws
newpath
16 677.74 moveto
16 678.74 lineto
412 678.74 lineto
412 677.74 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.336 661.18(typedef  long  GlyphIndex;) 4 147.956 ws
37.336 649.66(typedef  unsigned  int  GlyphBreakType;) 6 206.867 ws
37.336 626.62(interface  Glyph  :  Resource  {) 8 161.837 ws
45.666 615.1(void  request\(Requisition&\)  const;) 4 192.386 ws
45.666 603.58(void  allocate\(Canvas*,  const  Allocation&,  Extension&\);) 8 286.876 ws
45.666 592.06(void  draw\(Canvas*,  const  Allocation&\)  const;) 8 244.627 ws
45.666 580.54(void  undraw\(\);) 2 109.016 ws
45.666 569.02(void  print\(Printer*,  const  Allocation&\)  const;) 8 237.957 ws
45.666 557.5(void  pick\(Canvas*,  const  Allocation&,  int  depth,  Hit&\);) 12 282.427 ws
45.666 534.46(enum  {  no_break,  pre_break,  in_break,  post_break  };) 12 279.687 ws
45.666 522.94(Glyph*  compose\(GlyphBreakType\)  const;) 4 229.616 ws
45.666 499.9(void  append\(Glyph*\);) 2 139.596 ws
45.666 488.38(void  prepend\(Glyph*\);) 2 142.926 ws
45.666 476.86(void  insert\(GlyphIndex,  Glyph*\);) 4 186.826 ws
45.666 465.34(void  remove\(GlyphIndex\);) 2 160.146 ws
45.666 453.82(void  replace\(GlyphIndex,  Glyph*\);) 4 195.166 ws
45.666 442.3(void  change\(GlyphIndext\);) 2 162.386 ws
45.666 430.78(GlyphIndex  count\(\)  const;) 4 159.606 ws
45.666 419.26(Glyph*  component\(GlyphIndex\)  const;) 4 214.626 ws
45.666 407.74(void  allotment\(GlyphIndext,  DimensionName,  Allotment&\)  const;) 8 330.206 ws
37.336 396.22(};  ) 2 46.2363 ws
10 /Helvetica sf
157.036 379.7(Figure  2.1:) 2 204.836 ws
213.166 379.7(Glyph  protocol) 2 277.636 ws
newpath
16 371.53 moveto
16 372.53 lineto
412 372.53 lineto
412 371.53 lineto
closepath
gsave eofill grestore
12 /Times-Roman sf
388.24 36.96(2-) 2 398.236 as
401.236 36.96(2) 1 407.236 as
showpage
%%Page: 3 3
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 311.21(Hit::end.   Hit::target  indicates  that  a  glyph's  output  intersects  the  hit  region.) 21 412 ws
16 297.47(Hit::begin  and  Hit::end  are  used  by  composite  glyphs  that  should  be  on  the  hit) 26 412 ws
16 283.73(list  if  and  only  if  one  of  their  components  calls  Hit::target.   The  parameters  to) 27 412 ws
16 269.99(Hit::begin  and  Hit::target  have  the  same  meaning.   The  depth  is  the  level  in  the  hit) 29 412 ws
16 256.25(list  where  the  information  should  be  stored.   The  glyph  is  the  hit  glyph.   The  index) 30 412 ws
16 242.51(is  additional  information  about  the  hit.   For  a  composite  glyph,  this  is  typically) 25 412 ws
16 228.77(the  index  of  the  hit  child.   Hit::remove  and  Hit::retarget  modify  the  current  hit) 25 412 ws
16 215.03(information.) 12 75.664 as
26.668 200.39(The  remaining  hit  operations  return  information  about  a  pick.   The  result  is) 23 412 ws
16 186.65(a  list  of  paths,  each  of  which  contains  a  list  of  glyphs  terminating  with  the) 28 412 ws
16 172.91(glyphs  that  would  draw  through  the  pick  region.   Hit::count  returns  the  number  of) 25 412 ws
16 159.17(paths.   Hit::depth  returns  the  index  of  the  last  glyph  in  a  specified  path.   The  path) 30 412 ws
16 145.43(corresponding  to  the  top-most  glyph  is  in  position  zero.   Hit::target  and  Hit::index) 23 412 ws
16 131.69(return  the  information  for  a  given  path  and  depth.) 16 253.626 ws
26.668 117.05(If  a  pick  is  done  on  a  hit  object  constructed  from  an  event,  and  one  or  more) 32 412 ws
16 103.31(glyphs  find  the  event  of  interest,  they  will  associate  a  handler  with  the  hit  object.) 28 412 ws
16 89.57(Hit::handler  returns  the  top-most,  deepest  handler,  or  nil  if  there  is  none.) 22 363.953 ws
388.24 36.96(2-) 2 398.236 as
401.236 36.96(3) 1 407.236 as
newpath
17.2 647.26 moveto
17.2 648.26 lineto
413.2 648.26 lineto
413.2 647.26 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.536 630.7(interface  Hit  {) 4 98.0067 ws
46.866 619.18(Hit\(const  Event*\);) 2 124.666 ws
46.866 607.66(Hit\(Coord  x,  Coord  y\);) 6 144.107 ws
46.866 596.14(Hit\(Coord  left,  Coord  bottom,  Coord  right,  Coord  top\);) 14 282.507 ws
46.866 579.62(const  Event*  event\(\)  const;) 6 166.367 ws
46.866 568.1(Coord  left\(\)  const,  bottom\(\)  const,  right\(\)  const,  top\(\)  const;) 16 306.957 ws
46.866 551.58(void  push_transform\(\);) 2 146.896 ws
46.866 540.06(void  transform\(const  Transformer&\);) 4 207.456 ws
46.866 528.54(void  pop_transform\(\);) 2 141.896 ws
46.866 512.02(void  begin\(int  depth,  Glyph*,  GlyphIndex,  Handler*  =  nil\);) 14 297.817 ws
46.866 500.5(void  target\(int  depth,  Glyph*,  GlyphIndex,  Handler*  =  nil\);) 14 298.927 ws
46.866 488.98(void  end\(\);) 2 94.1064 ws
46.866 477.46(void  remove\(int  depth,  GlyphIndex  target  =  0\);) 12 250.577 ws
46.866 465.94(void  retarget\() 2 105.776 ws
55.196 454.42(int  depth,  Glyph*,  GlyphIndex,  Handler*  =  nil,  GlyphIndex  =  0) 18 324.227 ws
46.866 442.9(\);) 2 52.976 as
46.866 426.38(boolean  any\(\)  const;) 4 137.467 ws
46.866 414.86(int  count\(\)  const;) 4 120.787 ws
46.866 403.34(int  depth\(GlyphIndex  target  =  0\)  const;) 10 217.237 ws
46.866 391.82(Glyph*  target\(int  depth,  GlyphIndex  target  =  0\)  const;) 14 281.157 ws
46.866 380.3(GlyphIndex  index\(int  depth,  GlyphIndex  =  0\)  const;) 12 271.707 ws
46.866 368.78(Handler*  handler\(\)  const;) 4 158.017 ws
38.536 357.26(};) 2 44.656 as
10 /Helvetica sf
149.626 340.74(Figure  2.2:) 2 197.426 ws
205.756 340.74(Hit  class  interface.) 4 287.446 ws
newpath
17.2 332.57 moveto
17.2 333.57 lineto
413.2 333.57 lineto
413.2 332.57 lineto
closepath
gsave eofill grestore
showpage
%%Page: 4 4
90.05 36.94 translate
0 0 0 setrgbcolor
18 /Times-Bold sf
16 667.52(2.3) 3 38.5 as
51 667.52(Composition) 11 149.01 as
12 /Times-Roman sf
16 635.12(BreakType  defines  the  choices  for  how  a  composite  glyph  might  break  a  group  of) 26 412 ws
16 621.38(glyphs  in  a  layout.   The  break  may  occur  before  a  glyph  \(pre_break\),  in  the  glyph) 29 412 ws
16 607.64(\(in_break\),  or  after  the  glyph  \(post_break\).) 10 221.609 ws
26.668 593(Glyph::compose  returns  a  new  glyph  that  should  be  used  to  replace  the  target) 24 412 ws
16 579.26(glyph  when  the  break  occurs.  For  example,  discretionary  white  space  in  a) 22 412 ws
16 565.52(document  will  turn  into  zero-size  glue  if  a  line-break  or  page-break  occurs  on  it.  ) 28 403.576 ws
18 /Times-Bold sf
16 524.24(2.4) 3 38.5 as
51 524.24(Structure) 9 124.98 as
12 /Times-Roman sf
16 491.84(Several  operations  are  provided  to  manipulate  the  list  of  components  that  make  up) 24 412 ws
16 478.1(a  composite  glyph.   Primitive  glyphs  ignore  these  operations,  while  monoglyphs) 19 412 ws
16 464.36(pass  the  operation  through  to  their  body.   A  monoglyph  is  therefore  ``transparent'') 23 412 ws
16 450.62(with  respect  to  structure,  allowing  one  to  put  a  monoglyph  around  a  composite  and) 26 412 ws
16 436.88(pass  the  result  to  another  object  that  manipulates  the  components  of  the  composite.) 24 412 ws
26.668 422.24(Glyph::append  \(prepend\)  adds  a  given  glyph  to  the  end  \(beginning\)  of  the) 22 412 ws
16 408.5(component  list.   Glyph::insert  adds  a  given  glyph  at  a  specified  index  in  the  list.) 27 412 ws
16 394.76(Glyph::remove  removes  the  glyph  at  the  specified  index.   Glyph::replace  replaces) 19 412 ws
16 381.02(the  glyph  at  the  specified  index  with  the  given  glyph.   Glyph::change  notifies  a) 25 412 ws
16 367.28(glyph  that  its  component  at  the  given  index  has  changed,  and  therefore  it  might  be) 28 412 ws
16 353.54(necessary  to  reallocate  it.) 6 137.297 ws
26.668 338.9(Glyph::count  returns  the  number  of  glyphs  in  its  component  list.) 18 412 ws
16 325.16(Glyph::component  returns  the  glyph  in  its  component  list  at  the  given  index.) 22 412 ws
16 311.42(Glyph::allotment  returns  the  allocation  information  in  the  given  dimension  for  the) 20 412 ws
16 297.68(glyph  at  the  given  index  in  its  component  list.) 16 235.674 ws
18 /Times-Bold sf
16 256.4(2.5) 3 38.5 as
51 256.4(Requisitions) 12 146.022 as
12 /Times-Roman sf
16 224(Glyphs  define  their  geometric  needs  with  a  ) 14 257.632 ws
12 /Times-Italic sf
257.632 224(requisition) 11 309.64 as
12 /Times-Roman sf
309.64 224(,  which  specifies  a) 6 412 ws
12 /Times-Italic sf
16 210.26(requirement) 11 74.656 as
12 /Times-Roman sf
74.656 210.26(  in  each  dimension.   Figure  2.3  shows  the  requisition  and  requirement) 21 412 ws
16 196.52(class  interfaces.) 2 91.9724 ws
26.668 181.88(Requisition::penalty  is  overloaded  to  set  or  get  the  penalty  associated  with) 20 412 ws
16 168.14(choosing  a  break  at  the  position  defined  by  the  requisition.   Requisition::require) 21 412 ws
16 154.4(sets  a  requirement  in  a  given  dimension.   Requisition::requirement  returns  the) 19 412 ws
16 140.66(requirement  for  a  given  dimension.) 8 184.973 ws
26.668 126.02(A  requirement  consists  of  a  natural  size,  stretchability,  shrinkability,  and) 18 412 ws
16 112.28(alignment.   The  maximum  size  is  the  natural  size  plus  the  stretchability;  the) 23 412 ws
16 98.5401(minimum  is  the  natural  minus  the  shrinkability.   It  is  possible  to  have  negative) 25 412 ws
16 84.8001(minimum  sizes.   The  alignment  is  a  fraction  that  indicates  the  origin  of  the  area.) 27 412 ws
16 71.0601(An  alignment  of  zero  means  the  origin  is  at  the  lower  coordinate  value;  an) 26 412 ws
388.24 36.96(2-) 2 398.236 as
401.236 36.96(4) 1 407.236 as
showpage
%%Page: 5 5
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 363.45(alignment  of  one  means  it  is  at  the  upper  coordinate  value.) 20 296.957 ws
26.668 348.81(There  are  four  constructors  for  requirement:  with  no  parameters,  which  makes) 20 412 ws
16 335.07(the  natural  size  undefined  and  the  other  fields  zero;  with  a  single  coordinate  that) 26 412 ws
16 321.33(defines  the  natural  size  and  makes  the  other  fields  zero;  with  explicit  coordinates) 24 412 ws
16 307.59(for  the  natural  size,  stretchability,  and  shrinkability,  and  a  float  value  for  the) 24 412 ws
16 293.85(alignment;  and  with  explicit  coordinates  for  specifying  the  distances  on  each  side) 22 412 ws
16 280.11(of  the  origin.) 4 78.3288 ws
26.668 265.47(Requirement::equals  compares  two  requirements  \(the  target  object  and  the) 16 412 ws
16 251.73(argument\)  using  a  given  tolerance  for  the  individual  coordinate  comparisons.) 18 412 ws
16 237.99(Requirement::defined  returns  whether  the  natural  size  has  been  defined.   The) 19 412 ws
16 224.25(overloaded  functions  natural,  stretch,  shrink,  and  alignment  set  and  get  the) 20 412 ws
16 210.51(respective  values.) 2 101.308 ws
18 /Times-Bold sf
16 169.23(2.6) 3 38.5 as
51 169.23(Allocations) 11 137.004 as
12 /Times-Roman sf
16 136.83(The  actual  size  a  glyph  is  given  is  defined  by  an  ) 22 277.876 ws
12 /Times-Italic sf
277.876 136.83(allocation) 10 326.548 as
12 /Times-Roman sf
326.548 136.83(,  which  specifies) 4 412 ws
16 123.09(an  ) 2 32.0257 ws
12 /Times-Italic sf
32.0257 123.09(allotment) 9 77.3617 as
12 /Times-Roman sf
77.3617 123.09(  in  each  dimension.   Figure  2.4  shows  the  allocation  and  allotment) 21 412 ws
16 109.35(class  interfaces.  An  allotment  specifies  one  dimension  of  an  allocation  with  three) 22 412 ws
16 95.61(values:  an  origin,  a  span,  and  an  alignment.   The  origin  is  a  position  within  the) 29 412 ws
16 81.87(allotment  and  the  span  is  the  size  of  the  allotment.   The  alignment  is  a  fraction) 29 412 ws
16 68.13(specifying  the  position  of  the  origin.   For  example,  if  the  origin  is  1,  span  is  10,) 31 412 ws
388.24 36.96(2-) 2 398.236 as
401.236 36.96(5) 1 407.236 as
newpath
17.2 677.98 moveto
17.2 678.98 lineto
413.2 678.98 lineto
413.2 677.98 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.536 661.42(interface  Requisition  {) 4 135.247 ws
46.866 649.9(void  penalty\(int\);) 2 120.226 ws
46.866 638.38(int  penalty\(\)  const;) 4 128.567 ws
46.866 626.86(boolean  equals\(const  Requisition&,  float  epsilon\)  const;) 10 292.537 ws
46.866 615.34(void  require\(DimensionName,  const  Requirement&\);) 6 278.596 ws
46.866 603.82(const  Requirement&  requirement\(DimensionName\)  const;) 6 303.606 ws
46.866 592.3(Requirement&  requirement\(DimensionName\);) 2 250.246 ws
38.536 580.78(};) 2 44.656 as
38.536 564.26(interface  Requirement  {) 4 143.027 ws
46.866 552.74(Requirement\(Coord  natural\);) 2 174.126 ws
46.866 541.22(Requirement\(Coord  natural,  Coord  stretch,  Coord  shrink,  float\);) 12 326.406 ws
46.866 529.7(Requirement\() 12 107.436 as
55.196 518.18(Coord  natural_lead,  Coord  max_lead,  Coord  min_lead,) 10 298.076 ws
55.196 506.66(Coord  natural_trail,  Coord  max_trail,  Coord  min_trail) 10 286.927 ws
46.866 495.14(\);) 2 52.976 as
46.866 478.62(boolean  equals\(const  Requirement&,  float  epsilon\)  const;) 10 300.316 ws
46.866 467.1(boolean  defined\(\)  const;) 4 154.146 ws
46.866 455.58(void  natural\(Coord\),  stretch\(Coord\),  shrink\(Coord\);) 6 270.806 ws
46.866 444.06(Coord  natural\(\)  const,  stretch\(\)  const,  shrink\(\)  const;) 12 278.047 ws
46.866 432.54(void  alignment\(float\);) 2 139.676 ws
46.866 421.02(float  alignment\(\)  const;) 4 148.017 ws
38.536 409.5(};) 2 44.656 as
10 /Helvetica sf
105.161 392.98(Figure  2.3:) 2 152.961 ws
161.291 392.98(Requisition  and  Requirement  classes.  ) 8 331.911 ws
newpath
17.2 384.81 moveto
17.2 385.81 lineto
413.2 385.81 lineto
413.2 384.81 lineto
closepath
gsave eofill grestore
showpage
%%Page: 6 6
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 393.37(and  alignment  is  0.5,  then  the  allotment  begins  at  -4  and  ends  at  6.) 26 333.977 ws
26.668 378.73(The  allocation  constructor  initializes  each  allotment  to  have  zero  values.) 18 412 ws
16 364.99(Allocation::equals  compares  two  allocations  using  a  tolerance  for  individual) 16 412 ws
16 351.25(coordinate  comparisions.   Allocation::allot  sets  the  allotment  for  a  given) 17 412 ws
16 337.51(dimension.   Allocation::allotment  returns  the  allotment  for  a  specified  dimension.) 17 406.144 ws
26.668 322.87(Several  operations  are  provided  for  convenience  when  accessing  allotments  in) 18 412 ws
16 309.13(the  X  and  Y  dimensions.   Allocation::x  and  Allocation::y  return  the  X  and  Y) 25 412 ws
16 295.39(origins.   Allocation::left  and  Allocation::right  return  the  X  dimension  end-points,) 17 412 ws
16 281.65(Allocation::bottom  and  Allocation::top  return  the  Y  dimension  end-points.) 14 373.996 ws
26.668 267.01(The  Allotment  class  also  provides  an  equals  operation  for  comparing  two) 20 412 ws
16 253.27(allotments  with  a  given  tolerance.   Allotment::origin,  Allotment::span,  and) 15 412 ws
16 239.53(Allotment::alignment  are  overloaded  names  for  setting  and  getting  the  allotment) 18 412 ws
16 225.79(values.   Allotment::offset  adds  to  the  current  origin.) 13 263.477 ws
26.668 211.15(Allotment::begin  and  Allotment::end  return  the  end-points  of  an  allotment.) 16 412 ws
16 197.41(Allotment::begin  is  equivalent  to  the  origin  minus  the  alignment  times  the  span.) 22 412 ws
16 183.67(Allotment::end  is  equivalent  to  Allotment::begin  plus  the  span.) 14 318.677 ws
18 /Times-Bold sf
16 142.39(2.7) 3 38.5 as
51 142.39(Extensions) 10 134.016 as
12 /Times-Roman sf
16 109.99(The  area  that  defines  where  a  glyph  actually  draws  is  called  an  ) 24 335.848 ws
12 /Times-Italic sf
335.848 109.99(extension) 9 381.172 as
12 /Times-Roman sf
381.172 109.99(.   This) 3 412 ws
16 96.25(area  is  typically  used  for  update.   If  a  glyph  needs  to  be  completely  redrawn,  the) 29 412 ws
16 82.51(glyph's  extension  must  be  damaged.) 8 190.985 ws
26.668 67.87(Extensions  are  represented  in  device-independent  units,  but  must  be  rounded) 18 412 ws
388.24 36.96(2-) 2 398.236 as
401.236 36.96(6) 1 407.236 as
newpath
16 663.34 moveto
16 664.34 lineto
412 664.34 lineto
412 663.34 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.336 646.78(interface  Allocation  {) 4 127.937 ws
45.666 635.26(boolean  equals\(const  Allocation&,  float  epsilon\)  const;) 10 285.227 ws
45.666 623.74(void  allot\(DimensionName,  const  Allotment&\);) 6 249.056 ws
45.666 612.22(Allotment&  allotment\(DimensionName\);) 2 220.706 ws
45.666 600.7(const  Allotment&  allotment\(DimensionName\)  const;) 6 274.066 ws
45.666 589.18(Coord  x\(\)  const,  y\(\)  const;) 8 160.697 ws
45.666 577.66(Coord  left\(\)  const,  right\(\)  const,  bottom\(\)  const,  top\(\)  const;) 16 305.757 ws
37.336 566.14(};) 2 43.456 as
37.336 543.1(interface  Allotment  {) 4 126.267 ws
45.666 531.58(Allotment\(Coord  origin,  Coord  span,  float  alignment\);) 10 279.087 ws
45.666 520.06(boolean  equals\(const  Allotment&,  float  epsilon\)  const;) 10 283.557 ws
45.666 508.54(void  origin\(Coord\),  offset\(Coord\),  span\(Coord\);) 6 252.946 ws
45.666 497.02(Coord  origin\(\)  const,  span\(\)  const;) 8 196.827 ws
45.666 485.5(void  alignment\(float\);) 2 138.476 ws
45.666 473.98(float  alignment\(\)  const;) 4 146.817 ws
45.666 462.46(Coord  begin\(\)  const;) 4 136.257 ws
45.666 450.94(Coord  end\(\)  const;) 4 128.477 ws
37.336 439.42(};  ) 2 46.2364 ws
10 /Helvetica sf
100.346 422.9(Figure  2.4:) 2 148.146 ws
156.476 422.9(Allocation  and  allotment  class  interfaces) 8 334.326 ws
newpath
16 414.73 moveto
16 415.73 lineto
412 415.73 lineto
412 414.73 lineto
closepath
gsave eofill grestore
showpage
%%Page: 7 7
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 503.05(out  to  the  nearest  device-dependent  units.   For  example,  if  one  of  the  bounds  for) 27 412 ws
16 489.31(one  glyph's  extension  is  10.2  and  another  is  10.5,  we  would  need  to  redraw) 26 412 ws
16 475.57(both  glyphs  if  the  bounds  translate  to  the  same  pixel  coordinate.   Because) 23 412 ws
16 461.83(extensions  are  typically  used  to  damage  a  canvas,  the  extension  coordinates  are) 22 412 ws
16 448.09(canvas-relative.) 16 91.636 as
26.668 433.45(A  glyph  computes  its  extension  as  part  of  the  allocate  operation.   Typically,  a) 25 412 ws
16 419.71(glyph  will  simply  return  its  allocation  rounded  according  to  the  canvas.) 20 358.301 ws
26.668 405.07(Figure  2.5  shows  the  Extension  protocol.   Extension::set  initializes  an  extension) 19 412 ws
16 391.33(to  the  given  allocation  transformed  and  rounded  for  the  given  canvas.) 20 412 ws
16 377.59(Extension::clear  sets  an  extension  to  be  an  empty  area.   Extension::merge  extends) 21 412 ws
16 363.85(an  extension  to  include  a  new  area  in  addition  to  its  current  one.) 24 322.949 ws
26.668 349.21(Extension::set_xy  and  Extension::merge_xy  are  short-hand  for  adjusting  an) 14 412 ws
16 335.47(extension  to  include  a  given  bounding  box.   Extension::left,  bottom,  right,  and  top) 23 412 ws
16 321.73(return  the  bounding  box.) 6 134.657 ws
18 /Times-Bold sf
16 280.45(2.8) 3 38.5 as
51 280.45(Polyglyphs) 10 135.024 as
12 /Times-Roman sf
16 248.05(A  composite  glyph  contains  one  or  more  components.   Any  glyph  subclass) 21 412 ws
16 234.31(may  contain  subcomponents,  but  composite  glyphs  are  typically  derived  from) 18 412 ws
16 220.57(PolyGlyph  to  be  able  to  store  and  retrieve  their  children.) 18 286.625 ws
26.668 205.93(The  PolyGlyph  protocol,  shown  in  Figure  2.6  adds  one  operation  beyond  the) 22 412 ws
16 192.19(base  class,  PolyGlyph::modified\(GlyphIndex\),  which  notifies  the  glyph  that  the) 16 412 ws
16 178.45(given  component  has  changed.   This  operation  is  called  when  a  glyph  is  inserted) 25 412 ws
16 164.71(or  removed  from  the  composite.) 8 170.309 ws
18 /Times-Bold sf
16 123.43(2.9) 3 38.5 as
51 123.43(MonoGlyphs) 10 151.026 as
12 /Times-Roman sf
16 91.03(MonoGlyph  is  an  abstract  class  for  glyphs  that  contain  a  single  glyph,  called  its) 26 412 ws
12 /Times-Italic sf
16 77.29(body) 4 39.328 as
12 /Times-Roman sf
39.328 77.29(.   The  default  behavior  of  monoglyphs  is  to  pass  operations  on  to  the  body.) 27 412 ws
16 63.55(For  example,  the  implementation  of  MonoGlyph::draw  simply  calls  draw  on) 18 412 ws
388.24 36.96(2-) 2 398.236 as
401.236 36.96(7) 1 407.236 as
newpath
20.08 680.86 moveto
20.08 681.86 lineto
416.08 681.86 lineto
416.08 680.86 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
41.416 664.3(interface  Extension  {  ) 6 135.357 ws
49.746 652.78(void  set\(Canvas*,  const  Allocation&\);) 6 213.697 ws
49.746 641.26(void  set_xy\(Canvas*,  Coord  left,  Coord  bottom,  Coord  right,  Coord  top\);) 18 366.536 ws
49.746 629.74(void  clear\(\);) 2 101.976 ws
49.746 618.22(void  merge\(const  Extension&\);) 4 185.906 ws
49.746 606.7(void  merge\(Canvas*,  const  Allocation&\);) 6 228.697 ws
49.746 595.18(void  merge_xy\() 2 118.096 ws
58.076 583.66(Canvas*,  Coord  left,  Coord  bottom,  Coord  right,  Coord  top) 16 315.407 ws
49.746 572.14(\);) 2 55.856 as
49.746 560.62(Coord  left\(\)  const,  bottom\(\)  const,  right\(\)  const,  top\(\)  const;) 16 309.837 ws
41.416 549.1(};) 2 47.536 as
10 /Helvetica sf
152.221 532.58(Figure  2.5:) 2 200.021 ws
208.351 532.58(Extension  protocol) 2 290.611 ws
newpath
20.08 524.41 moveto
20.08 525.41 lineto
416.08 525.41 lineto
416.08 524.41 lineto
closepath
gsave eofill grestore
showpage
%%Page: 8 8
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 577.93(the  body.   This  feature  is  very  useful  because  it  means  that  a  monoglyph  can) 27 412 ws
16 564.19(affect  one  aspect  of  the  body's  behavior  without  changing  other  aspects.   In) 23 412 ws
16 550.45(particular,  monoglyphs  usually  do  not  change  structure  management.   Therefore,  a) 19 412 ws
16 536.71(monoglyph  can  be  \252wrapped\272  around  a  composite  glyph  and  the  result  passed  to) 24 412 ws
16 522.97(an  object  that  modifies  the  structure  of  the  composite  without  knowing  about  the) 24 412 ws
16 509.23(presence  of  the  monoglyph.   For  example,  suppose  a  prototype  menu  is  built  and) 25 412 ws
16 495.49(returned  to  a  function  that  appends  the  items.   All  the  function  need  assume  is  that) 29 412 ws
16 481.75(the  prototype  is  some  glyph;  it  can  use  Glyph::append  to  put  in  the  items.   The) 29 412 ws
16 468.01(arrangement  of  the  items  will  be  defined  by  the  aggregate  and  any  additional) 24 412 ws
16 454.27(decoration,  such  as  a  3D  borderframe  or  shadow,  can  be  wrapped  around  the) 24 412 ws
16 440.53(aggregate  independently.) 2 136.636 ws
26.668 425.89(Figure  2.7  shows  the  MonoGlyph  base  class  interface.  A  non-nil  glyph  specifies) 22 412 ws
16 412.15(the  initial  body.   MonoGlyph::body  is  overloaded  to  set  and  return  the  body.) 23 381.148 ws
14 /Times-Bold sf
16 385.75(2.9.1) 5 44 as
56 385.75(Patches) 7 101.878 as
12 /Times-Roman sf
16 365.31(A  patch  stores  its  canvas  and  allocation  for  subsequent  use  to  update  its  body.   A) 29 412 ws
16 351.57(patch  is  useful  for  objects  that  need  to  be  redrawn  independently,  such  as  those) 26 412 ws
16 337.83(that  depend  on  some  external  data.   Typically,  a  patch  appears  in  the  middle  of  a) 29 412 ws
16 324.09(glyph  instance  graph,  where  a  change  would  be  too  expensive  to  redraw  the  entire) 26 412 ws
16 310.35(graph.) 6 46.324 as
26.668 295.71(Figure  2.8  shows  the  Patch  class  interface.   Patch::canvas  and  Patch::allocation) 19 412 ws
16 281.97(return  the  canvas  and  allocation  most  recently  passed  to  Patch::draw.) 18 412 ws
16 268.23(Patch::reallocate  calls  allocate  on  the  body  using  the  current  allocation,  usually) 20 412 ws
16 254.49(because  the  body  has  changed  in  some  way  and  will  allocate  its  itself  differently.) 26 412 ws
16 240.75(Patch::redraw  calls  draw  on  the  body  using  the  current  allocation.   Patch::repick) 21 412 ws
16 227.01(returns  the  result  of  calling  pick  on  the  body  with  the  current  canvas  and  allocation.) 28 412 ws
388.24 36.96(2-) 2 398.236 as
401.236 36.96(8) 1 407.236 as
newpath
16.24 675.1 moveto
16.24 676.1 lineto
412.24 676.1 lineto
412.24 675.1 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.576 658.54(interface  PolyGlyph  :  Glyph  {) 8 164.857 ws
45.906 647.02(PolyGlyph\(GlyphIndex  initial_size  =  10\);) 6 222.917 ws
45.906 635.5(void  modified\(GlyphIndex\);) 2 164.836 ws
37.576 623.98(};) 2 43.696 as
10 /Helvetica sf
148.661 607.46(Figure  2.6:) 2 196.461 ws
204.791 607.46(Polyglyph  protocol) 2 286.491 ws
newpath
16.24 599.29 moveto
16.24 600.29 lineto
412.24 600.29 lineto
412.24 599.29 lineto
closepath
gsave eofill grestore
newpath
16.96 181.42 moveto
16.96 182.42 lineto
412.96 182.42 lineto
412.96 181.42 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.296 164.86(interface  MonoGlyph  :  Glyph  {) 8 171.137 ws
46.626 153.34(void  body\(Glyph*\);) 2 128.876 ws
46.626 141.82(Glyph*  body\(\)  const;) 4 137.217 ws
38.296 130.3(};  ) 2 47.1964 ws
10 /Helvetica sf
145.491 113.78(Figure  2.7:) 2 193.291 ws
201.621 113.78(MonoGlyph  protocol) 2 291.101 ws
newpath
16.96 105.61 moveto
16.96 106.61 lineto
412.96 106.61 lineto
412.96 105.61 lineto
closepath
gsave eofill grestore
showpage
%%Page: 9 9
90.05 36.94 translate
0 0 0 setrgbcolor
18 /Times-Bold sf
16 525.85(2.10) 4 47.5 as
51 525.85(Example) 7 119.004 as
12 /Times-Roman sf
16 493.45(See  iv/src/examples/circle.  ) 4 147.641 ws
388.24 36.96(2-) 2 398.236 as
401.236 36.96(9) 1 407.236 as
newpath
14.08 672.94 moveto
14.08 673.94 lineto
410.08 673.94 lineto
410.08 672.94 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
35.416 656.38(interface  Patch  :  MonoGlyph  {) 8 167.707 ws
43.746 644.86(Patch\(Glyph*\);) 14 108.766 as
43.746 633.34(Canvas*  canvas\(\)  const;) 4 152.117 ws
43.746 621.82(const  Allocation&  allocation\(\)  const;) 6 201.587 ws
43.746 610.3(void  reallocate\(\);) 2 117.656 ws
43.746 598.78(void  redraw\(\)  const;) 4 131.547 ws
43.746 587.26(boolean  repick\(int  depth,  Hit&\);) 6 181.027 ws
35.416 575.74(};  ) 2 44.3164 ws
10 /Helvetica sf
155.391 559.22(Figure  2.8:) 2 203.191 ws
211.521 559.22(Patch  protocol) 2 275.441 ws
newpath
14.08 551.05 moveto
14.08 552.05 lineto
410.08 552.05 lineto
410.08 551.05 lineto
closepath
gsave eofill grestore
showpage
%%Trailer
end restore
%%Pages: 9
%!PS-Adobe-2.0
%%Creator: ./ch3.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
16 662.72(Chapter  3) 2 119.321 ws
16 625.76(Event  processing) 2 190.001 ws
12 /Times-Roman sf
16 597.44(This  chapter  describes  the  InterViews  mechanisms  for  processing  user  input.   An) 21 412 ws
12 /Times-Italic sf
16 583.7(event) 5 41.32 as
12 /Times-Roman sf
41.32 583.7(  is  an  object  that  represents  a  user  input  action,  such  as  pressing  a  mouse) 28 412 ws
16 569.96(button  or  a  keystroke.   Events  are  low-level  objects  that  application  code  should) 23 412 ws
16 556.22(rarely  need  to  access  directly.   A  ) 13 182.226 ws
12 /Times-Italic sf
182.226 556.22(handler) 7 219.558 as
12 /Times-Roman sf
219.558 556.22(  is  an  object  that  processes  events.   An) 15 412 ws
12 /Times-Italic sf
16 542.48(input  handler) 2 81.0326 ws
12 /Times-Roman sf
81.0326 542.48(  is  a  glyph  that  provides  a  handler  that  translates  events  to  operations) 24 412 ws
16 528.74(such  as  press,  release,  and  keystroke.) 10 193.949 ws
18 /Times-Bold sf
16 487.46(3.1) 3 38.5 as
51 487.46(Events) 6 103.002 as
12 /Times-Roman sf
16 455.06(The  event  class  interface  is  shown  in  Figure  3.1.   Input  events  arrive  in  a  single) 29 412 ws
16 441.32(stream  \(per  display\)  to  an  application.   EventType  is  the  kind  of  event  \(mouse) 25 412 ws
16 427.58(motion,  button  down,  etc.\).   An  application  receives  all  window  system  events,) 21 412 ws
16 413.84(but  Event::type  is  only  defined  for  device  input.   Other  events  have  the  type) 25 412 ws
16 400.1(Event::other_event) 18 107.32 as
10 /Helvetica sf
107.32 400.1(.) 1 110.1 as
12 /Times-Roman sf
110.1 400.1(   EventButton  is  the  number  of  a  button  on  a  pointing  device,) 23 412 ws
16 386.36(where  Event::any  refers  to  any  one  of  the  buttons.) 16 255.617 ws
26.668 371.72(Event::window  returns  the  window  that  received  the  event.   Event::pending) 17 412 ws
16 357.98(tests  if  more  events  are  waiting  to  be  read.   Event::unread  puts  the  event  at  the) 29 412 ws
16 344.24(front  of  the  input  queue  for  the  display.) 14 204.642 ws
393.52 37.04(3-) 2 403.516 as
406.516 37.04(1) 1 412.516 as
newpath
17.68 328.78 moveto
17.68 329.78 lineto
413.68 329.78 lineto
413.68 328.78 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
39.016 312.22(typedef  unsigned  int  EventType;) 6 181.877 ws
39.016 300.7(typedef  unsigned  long  EventTime;) 6 190.207 ws
39.016 289.18(typedef  unsigned  int  EventButton;) 6 188.557 ws
39.016 277.66(typedef  unsigned  int  EventModifierKey;) 6 212.437 ws
39.016 261.14(interface  Event  {) 4 111.837 ws
47.346 249.62(enum  {  undefined,  motion,  down,  up,  key,  other_event  };) 16 295.277 ws
47.346 238.1(enum  {  none,  any,  left,  middle,  right,  other_button  };) 16 274.707 ws
47.346 226.58(enum  {  control,  shift,  capslock,  meta  };) 12 216.317 ws
47.346 210.06(Window*  window\(\)  const;) 4 159.037 ws
47.346 198.54(boolean  pending\(\);) 2 130.726 ws
47.346 187.02(void  unread\(\);) 2 109.036 ws
47.346 175.5(EventType  type\(\)  const;) 4 152.947 ws
47.346 163.98(EventTime  time\(\)  const;) 4 152.927 ws
47.346 152.46(Coord  pointer_x\(\)  const,  pointer_y\(\)  const;) 8 234.637 ws
47.346 140.94(EventButton  pointer_button\(\)  const;) 4 204.656 ws
47.346 129.42(boolean  button_is_down\(EventButton\)  const;) 4 246.346 ws
47.346 117.9(boolean  modifier_is_down\(EventModifierKey\)  const;) 4 277.986 ws
47.346 106.38(unsigned  char  keycode\(\)  const;) 6 186.297 ws
47.346 94.86(unsigned  int  mapkey\(char*,  unsigned  int  len\)  const;) 12 274.117 ws
39.016 83.34(};) 2 45.136 as
10 /Helvetica sf
158.991 66.82(Figure  3.1:) 2 206.791 ws
215.121 66.82(Event  protocol) 2 279.041 ws
newpath
17.68 58.65 moveto
17.68 59.65 lineto
413.68 59.65 lineto
413.68 58.65 lineto
closepath
gsave eofill grestore
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
26.668 671.36(Event::time  returns  a  timestamp  in  milliseconds  for  the  event.   Event::pointer_x) 19 412 ws
16 657.62(and  Event::pointer_y  return  the  pointer  location  for  the  event  in  coordinates) 20 412 ws
16 643.88(relative  to  the  lower-left  corner  of  the  window.   Pointer  locations  are  defined) 23 412 ws
16 630.14(for  motion,  button,  and  keyboard  events.   Event::pointer_button  returns  the) 17 412 ws
16 616.4(EventButton  for  a  down  or  up  event,  Event::none  for  all  other  events.) 22 412 ws
16 602.66(Event::button_is_down  \(Event::modifier_is_down\)  returns  whether  the  given) 10 412 ws
16 588.92(button  \(modifier  key\)  was  down  ) 10 173.645 ws
12 /Times-Italic sf
173.645 588.92(before) 6 204.305 as
12 /Times-Roman sf
204.305 588.92(  the  event  occurred.) 6 298.937 ws
26.668 574.28(Event::keycode  returns  the  code  associated  with  a  keystroke.   Key  codes  are) 21 412 ws
16 560.54(potentially  platform-specific  and  should  be  avoided  if  possible.   Event::mapkey) 17 412 ws
16 546.8(finds  the  string  binding  for  a  given  key.   Event::mapkey  is  passed  a  buffer  for) 27 412 ws
16 533.06(the  result  and  the  size  of  the  buffer;  it  returns  the  number  of  characters  in  the) 30 412 ws
16 519.32(translated  string.   If  the  event  is  not  a  key  event,  Event::mapkey  returns  -1.) 25 373.109 ws
18 /Times-Bold sf
16 478.04(3.2) 3 38.5 as
51 478.04(Handlers) 8 122.01 as
12 /Times-Roman sf
16 445.64(A  handler  is  an  object  that  is  passed  an  event  to  process.   The  only  operation) 29 412 ws
16 431.9(is  Handler::event,  which  translates  a  raw  event  into  an  abstract  operation.) 20 412 ws
16 418.16(InputHandler  is  a  monoglygph  subclass  that  uses  a  handler  to  translate  events.) 22 412 ws
16 404.42(ActiveHandler  is  a  subclass  of  input  handler  that  detects  when  the  input  pointer) 24 412 ws
16 390.68(enters  or  leaves  its  body.   Figure  3.2  shows  the  handler,  input  handler,  and  active) 27 412 ws
16 376.94(handler  protocols.) 2 102.652 ws
26.668 362.3(The  InputHandler  constructor  is  passed  the  glyph  body  \(which  can  also) 20 412 ws
16 348.56(be  set  with  MonoGlyph::body\)  and  a  style.   Though  a  glyph  can  in  general) 25 412 ws
16 334.82(have  multiple  parents,  input  handlers  form  a  hierarchy  for  focus  management.) 20 412 ws
16 321.08(InputHandler::append_focusable  adds  a  child,  setting  the  child's  parent  to) 16 412 ws
16 307.34(the  target  input  handler.   InputHandler::remove_focusable  removes  a  child.) 15 412 ws
16 293.6(InputHandler::focus  sets  the  current  focus  for  the  input  handler.   The  effect  of) 23 412 ws
16 279.86(setting  focus  is  that  key  events  \(or  in  general  any  focusable  event\)  will  be) 26 412 ws
16 266.12(processed  by  the  focus  input  handler  as  opposed  to  an  input  handler  under  the) 26 412 ws
16 252.38(input  pointer  coordinates.) 4 138.989 ws
26.668 237.74(InputHandler::next_focus  and  InputHandler::prev_focus  move  the  focus) 10 412 ws
16 224(forward  and  backward  through  the  children  of  an  input  handler.) 18 412 ws
16 210.26(InputHandler::focus_in  moves  the  focus  \252down\272  the  hierarchy  and  returns  the) 18 412 ws
16 196.52(handler  that  now  has  focus.   InputHandler::focus_out  notifies  an  input  handler) 19 412 ws
16 182.78(that  it  no  longer  will  receive  focusable  events,  in  case  it  wishes  to  change  its) 28 412 ws
16 169.04(appearance.) 11 72.964 as
26.668 154.4(InputHandler::move,  press,  drag,  release,  and  keystroke  are  called  by  the) 18 412 ws
16 140.66(handler  in  response  to  motion,  button  down,  motion  while  a  button  is  down,) 24 412 ws
16 126.92(button  up,  and  key  events.   InputHandler::double_click  is  called  when  two) 19 412 ws
16 113.18(button  down  events  occurs  within  a  threshold  time.   The  threshold  is  set  by  the) 27 412 ws
16 99.4401(\252clickDelay\272  style  attribute;  the  default  is  250  milliseconds.) 14 303.305 ws
26.668 84.8001(InputHandler::allocation_changed  is  a  notification  that  the  glyph's  size  or) 16 412 ws
16 71.0601(position  has  changed;  subclasses  can  override  this  operation  and  therefore) 18 412 ws
393.52 37.04(3-) 2 403.516 as
406.516 37.04(2) 1 412.516 as
showpage
%%Page: 3 3
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 259.61(typically  do  not  need  to  define  an  allocate  operation.   InputHandler::redraw) 19 412 ws
16 245.87(damages  the  canvas  and  area  where  the  input  handler  was  most  recently  drawn.) 24 396.892 ws
26.668 231.23(The  implementation  of  ActiveHandler  notices  when  motion  events  first) 16 412 ws
16 217.49(intersect  the  glyph's  body,  in  which  case  ActiveHandler::enter  is  called,  and  when) 22 412 ws
16 203.75(the  motion  next  leaves  the  body,  in  which  case  ActiveHandler::leave  is  called.) 22 412 ws
16 190.01(The  default  enter  and  leave  operations  do  nothing;  subclasses  should  define  these) 22 412 ws
16 176.27(operations  as  desired.) 4 119.645 ws
18 /Times-Bold sf
16 134.99(3.3) 3 38.5 as
51 134.99(Targets) 7 109.986 as
12 /Times-Roman sf
16 102.59(A  ) 2 30.1608 ws
12 /Times-Italic sf
30.1608 102.59(target) 6 58.8288 as
12 /Times-Roman sf
58.8288 102.59(  controls  the  behavior  of  picking  on  its  body.   A  target  is  useful  for) 27 412 ws
16 88.8502(defining  a  pick  area  that  is  not  identical  to  the  underlying  object.   For  example,  if) 29 412 ws
16 75.1102(one  wanted  to  pick  in  a  line  of  characters  then  one  might  wish  to  interpret  the  pick) 32 412 ws
16 61.3702(based  on  the  line  height  instead  of  the  heights  of  the  individual  characters.   So,  a) 29 412 ws
393.52 37.04(3-) 2 403.516 as
406.516 37.04(3) 1 412.516 as
newpath
17.68 676.3 moveto
17.68 677.3 lineto
413.68 677.3 lineto
413.68 676.3 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
39.0159 659.74(interface  Handler  :  Resource  {) 8 172.407 ws
47.3459 648.22(boolean  event\(Event&\)  ;) 4 154.626 ws
39.0159 636.7(};) 2 45.1359 as
39.0159 613.66(interface  InputHandler  :  MonoGlyph  {) 8 202.987 ws
47.3459 602.14(InputHandler\(Glyph*,  Style*\);) 2 175.726 ws
47.3459 585.62(Handler*  handler\(\)  const;) 4 158.496 ws
47.3459 574.1(InputHandler*  parent\(\)  const;) 4 175.736 ws
47.3459 562.58(Style*  style\(\)  const;) 4 132.927 ws
47.3459 551.06(void  append_input_handler\(InputHandler*\);) 2 238.556 ws
47.3459 539.54(void  remove_input_handler\(InputHandler*\);) 2 238.536 ws
47.3459 528.02(void  focus\(InputHandler*\);) 2 162.946 ws
47.3459 516.5(void  next_focus\(\);) 2 126.266 ws
47.3459 504.98(void  prev_focus\(\);) 2 126.816 ws
47.3459 493.46(InputHandler*  focus_in\(\);) 2 157.946 ws
47.3459 481.94(void  focus_out\(\);) 2 121.266 ws
47.3459 465.42(void  move\(const  Event&\);) 4 161.276 ws
47.3459 453.9(void  press\(const  Event&\);) 4 161.276 ws
47.3459 442.38(void  drag\(const  Event&\);) 4 156.836 ws
47.3459 430.86(void  release\(const  Event&\);) 4 169.616 ws
47.3459 419.34(void  keystroke\(const  Event&\);) 4 179.616 ws
47.3459 407.82(void  double_click\(const  Event&\);) 4 191.846 ws
47.3459 391.3(void  allocation_changed\(Canvas*,  const  Allocation&\);) 6 284.116 ws
47.3459 379.78(void  redraw\(\)  const;) 4 135.147 ws
39.0159 368.26(};) 2 45.1359 as
39.0159 351.74(interface  ActiveHandler  :  InputHandler  {) 8 214.097 ws
47.3459 340.22(ActiveHandler\(Glyph*,  Style*\);) 2 180.716 ws
47.3459 328.7(void  enter\(\);) 2 100.696 ws
47.3459 317.18(void  leave\(\);) 2 101.806 ws
39.0159 305.66(};) 2 45.1359 as
10 /Helvetica sf
112.026 289.14(Figure  3.2:) 2 159.826 ws
168.156 289.14(Handler  and  InputHandler  protocols) 6 326.006 ws
newpath
17.68 280.97 moveto
17.68 281.97 lineto
413.68 281.97 lineto
413.68 280.97 lineto
closepath
gsave eofill grestore
showpage
%%Page: 4 4
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 671.36(pick  lower  than  the  top  of  the  ``h''  in  ``the''  but  above  the  ``e''  will  not  miss.) 32 388.264 ws
26.668 656.72(Figure  3.3  shows  the  target  class  interface.   The  target  behavior  is  controlled  by) 25 412 ws
16 642.98(the  sensitivity  parameter  to  the  constructor.   TargetPrimitiveHit  means  the  body  is) 21 412 ws
16 629.24(hit  if  the  pick  region  intersects  the  target's  allocation.   TargetCharacterHit  means) 21 412 ws
16 615.5(the  body  is  hit  if  the  area  intersects  the  target's  allocation  in  the  X  dimension.) 28 388.288 ws
393.52 37.04(3-) 2 403.516 as
406.516 37.04(4) 1 412.516 as
newpath
16.72 414.22 moveto
16.72 415.22 lineto
412.72 415.22 lineto
412.72 414.22 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.056 397.66(enum  TargetSensitivity  {) 4 145.877 ws
46.386 386.14(TargetPrimitiveHit,) 19 128.616 as
46.386 374.62(TargetCharacterHit) 18 131.406 as
38.056 363.1(};) 2 44.176 as
38.056 346.58(interface  Target  :  MonoGlyph  {) 8 173.677 ws
46.386 335.06(Target\(Glyph*  body,  TargetSensitivity\);) 4 218.666 ws
38.056 323.54(};) 2 44.176 as
10 /Helvetica sf
142.196 307.02(Figure  3.3:) 2 189.996 ws
198.326 307.02(Target  class  interface) 4 293.916 ws
newpath
16.72 298.85 moveto
16.72 299.85 lineto
412.72 299.85 lineto
412.72 298.85 lineto
closepath
gsave eofill grestore
showpage
%%Trailer
end restore
%%Pages: 4
%!PS-Adobe-2.0
%%Creator: ./ch4.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
16 662.72(Chapter  4) 2 119.321 ws
16 625.76(Views) 5 77.32 as
12 /Times-Roman sf
16 597.44(This  chapter  describes  the  mechanisms  for  supporting  multiple  views  of  data.) 20 412 ws
16 583.7(Currently,  this  support  consists  of  three  protocols:   ) 15 282.301 ws
12 /Times-Italic sf
282.301 583.7(observable) 10 334.957 as
12 /Times-Roman sf
334.957 583.7(,  ) 2 343.82 ws
12 /Times-Italic sf
343.82 583.7(observer) 8 385.808 as
12 /Times-Roman sf
385.808 583.7(,  and) 2 412 ws
12 /Times-Italic sf
16 569.96(adjustable) 10 66.004 as
12 /Times-Roman sf
66.004 569.96(.   An  observable  object  is  one  that  has  one  or  more  observers  that  it  can) 29 412 ws
16 556.22(notify  \(typically  when  it  changes\).   An  adjustable  object  uses  an  observable  for) 23 412 ws
16 542.48(each  dimension  to  keep  track  of  observers  that  can  scroll  or  zoom  the  visible  areas) 28 412 ws
16 528.74(of  the  object.) 4 78.9888 ws
18 /Times-Bold sf
16 487.46(4.1) 3 38.5 as
51 487.46(Observable  and  Observer) 4 249.001 ws
12 /Times-Roman sf
16 455.06(Figure  4.1  shows  the  observable  and  observer  protocols.   An  observer  can  be) 23 412 ws
16 441.32(attached  or  detached  to  an  observable.   Observable::notify  calls  Observer::update) 17 412 ws
16 427.58(on  each  of  the  attached  observers.   When  an  observable  object  is  destroyed,  it  will) 27 412 ws
16 413.84(call  Observer::disconnect  on  any  attached  observers.) 10 268.601 ws
18 /Times-Bold sf
16 372.56(4.2) 3 38.5 as
51 372.56(Adjustable) 10 135.006 as
12 /Times-Roman sf
16 340.16(An  adjustable  is  an  object  that  handles  requests  to  modify  its  viewing  area.   For) 27 412 ws
16 326.42(example,  a  scrollable  list  is  adjustable  in  that  a  scrollbar  or  other  object  can) 26 412 ws
16 312.68(request  that  a  particular  subrange  of  items  in  the  list  be  shown.) 22 316.625 ws
26.668 298.04(Figure  4.2  shows  the  adjustable  protocol.   Adjustable::attach  and) 15 412 ws
16 284.3(Adjustable::detach  add  an  observer  to  the  list  of  objects  notified  when  a  particular) 24 412 ws
16 270.56(dimension  changes.   Adjustable::notify  calls  update  on  those  observers  attached  to) 19 412 ws
16 256.82(the  given  dimension.   Adjustable::notify_all  is  equivalent  to  calling  notify  on) 19 412 ws
16 243.08(every  dimension.) 2 98.6564 ws
393.52 37.04(4-) 2 403.516 as
406.516 37.04(1) 1 412.516 as
newpath
16.24 221.98 moveto
16.24 222.98 lineto
412.24 222.98 lineto
412.24 221.98 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.576 205.42(interface  Observable  {) 4 135.957 ws
45.906 193.9(void  attach\(Observer*\);) 2 148.716 ws
45.906 182.38(void  detach\(Observer*\);) 2 151.496 ws
45.906 170.86(void  notify\(\);) 2 100.366 ws
37.576 159.34(};) 2 43.696 as
37.576 142.82(interface  Observer  {) 4 125.947 ws
45.906 131.3(void  update\(Observable*\);) 2 162.066 ws
45.906 119.78(void  disconnect\(Observable*\);) 2 179.286 ws
37.576 108.26(};) 2 43.696 as
10 /Helvetica sf
111.701 91.7399(Figure  4.1:) 2 159.501 ws
167.831 91.7399(Observable  and  observer  protocols) 6 323.451 ws
newpath
16.24 83.57 moveto
16.24 84.57 lineto
412.24 84.57 lineto
412.24 83.57 lineto
closepath
gsave eofill grestore
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
26.668 357.29(Adjustable::lower  and  Adjustable::upper  define  a  coordinate  range  for) 14 412 ws
16 343.55(adjustment  in  a  specific  dimension.   Adjustable::length  is  equivalent) 15 412 ws
16 329.81(to  Adjustable::upper  minus  Adjustable::lower.   Adjustable::cur_lower  and) 11 412 ws
16 316.07(Adjustable::cur_upper  define  the  region  within  a  coordinate  range  that  is  currently) 20 412 ws
16 302.33(in  view.   Adjustable::cur_length  is  equivalent  to  Adjustable::cur_upper  minus) 15 412 ws
16 288.59(Adjustable::cur_lower.) 22 126.316 as
26.668 273.95(Adjustable::scroll_forward  and  Adjustable::scroll_backward  add  a  small  fixed) 12 412 ws
16 260.21(amount  to  Adjustable::cur_lower  \(where  the  amount  is  determined  by  the) 18 412 ws
16 246.47(adjustable  object\).   Adjustable::page_forward  and  Adjustable::page_backward) 9 412 ws
16 232.73(add  a  larger  fixed  amount.   Adjustable::scroll_to  sets  the  adjustable's  current) 19 412 ws
16 218.99(lower  coordinate  to  a  specific  value.   Adjustable::scale_to  sets  the  current  length) 21 412 ws
16 205.25(to  a  given  fraction  of  the  total  length.   Adjustable::zoom_to  sets  the  scale  in) 25 412 ws
16 191.51(all  dimensions  at  once.   Adjustable::constrain  restricts  a  value  to  be  within  the) 23 412 ws
16 177.77(adjustable's  lower  and  upper  bounds.) 8 194.969 ws
12 /Times-Italic sf
26.668 163.13(Example:  see  iv/src/examples/bvalue/main.c.) 4 242.62 ws
18 /Times-Bold sf
16 121.85(4.3) 3 38.5 as
51 121.85(View) 4 89.988 as
12 /Times-Italic sf
16 89.4501(This  section  will  be  completed  in  the  future.) 14 226.002 ws
12 /Times-Roman sf
393.52 37.04(4-) 2 403.516 as
406.516 37.04(2) 1 412.516 as
newpath
17.2 670.3 moveto
17.2 671.3 lineto
413.2 671.3 lineto
413.2 670.3 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.536 653.74(interface  Adjustable  {) 4 132.477 ws
46.866 642.22(Observable*  observable\(DimensionName\)  const;) 4 263.596 ws
46.866 630.7(void  attach\(DimensionName,  Observer*\);) 4 229.136 ws
46.866 619.18(void  detach\(DimensionName,  Observer*\);) 4 231.916 ws
46.866 607.66(void  notify\(DimensionName\)  const;) 4 201.906 ws
46.866 596.14(void  notify_all\(\)  const;) 4 143.567 ws
46.866 579.62(Coord  lower\(DimensionName\)  const;) 4 210.786 ws
46.866 568.1(Coord  upper\(DimensionName\)  const;) 4 212.466 ws
46.866 556.58(Coord  length\(DimensionName\)  const;) 4 214.136 ws
46.866 545.06(Coord  cur_lower\(DImensionName\)  const;) 4 230.796 ws
46.866 533.54(Coord  cur_upper\(DimensionName\)  const;) 4 231.916 ws
46.866 522.02(Coord  cur_length\(DimensionName\)  const;) 4 233.586 ws
46.866 505.5(void  scroll_forward\(DimensionName\);) 2 213.556 ws
46.866 493.98(void  scroll_backward\(DimensionName\);) 2 223.006 ws
46.866 482.46(void  page_forward\(DimensionName\);) 2 212.466 ws
46.866 470.94(void  page_backwards\(DimensionName\);) 2 226.916 ws
46.866 454.42(void  scroll_to\(DImensionName,  Coord  lower\);) 6 248.576 ws
46.866 442.9(void  scale_to\(DimensionName,  float  fraction\);) 6 248.596 ws
46.866 431.38(void  zoom_to\(float  magnification\);) 4 196.366 ws
46.866 414.86(void  constrain\(DimensionName,  Coord&\)  const;) 6 258.036 ws
38.536 403.34(};) 2 44.656 as
10 /Helvetica sf
147.951 386.82(Figure  4.2:) 2 195.751 ws
204.081 386.82(Adjustable  protocol) 2 289.121 ws
newpath
17.2 378.65 moveto
17.2 379.65 lineto
413.2 379.65 lineto
413.2 378.65 lineto
closepath
gsave eofill grestore
showpage
%%Page: 3 3
90.05 36.94 translate
0 0 0 setrgbcolor
18 /Times-Bold sf
16 667.52(4.4) 3 38.5 as
51 667.52(Data) 4 87.99 as
12 /Times-Italic sf
16 635.12(This  section  will  be  completed  in  the  future.) 14 226.002 ws
18 /Times-Bold sf
16 593.84(4.5) 3 38.5 as
51 593.84(Inset) 5 88.998 as
12 /Times-Italic sf
16 561.44(This  section  will  be  completed  in  the  future.) 14 226.002 ws
12 /Times-Roman sf
393.52 37.04(4-) 2 403.516 as
406.516 37.04(3) 1 412.516 as
showpage
%%Trailer
end restore
%%Pages: 3
%!PS-Adobe-2.0
%%Creator: ./ch5.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
16 662.72(Chapter  5) 2 119.321 ws
16 625.76(Windows) 7 112.024 as
12 /Times-Roman sf
16 597.44(The  previous  chapters  covered  the  composition  of  physical  \(glyphs\)  and  logical) 20 412 ws
16 583.7(\(views\)  objects.  This  chapter  discusses  the  other  objects  necessary  to  manage) 20 412 ws
16 569.96(where  glyphs  are  drawn.   A  ) 11 151.512 ws
12 /Times-Italic sf
151.512 569.96(window) 6 188.856 as
12 /Times-Roman sf
188.856 569.96(  is  an  object  that  can  be  mapped  onto  a  ) 20 380.68 ws
12 /Times-Italic sf
380.68 569.96(screen) 6 412 as
12 /Times-Roman sf
16 556.22(and  receive  input.   Associated  with  a  window  is  the  root  of  a  directed  acyclic  graph) 29 412 ws
16 542.48(of  glyphs.   The  window  creates  a  ) 13 182.573 ws
12 /Times-Italic sf
182.573 542.48(canvas) 6 215.897 as
12 /Times-Roman sf
215.897 542.48(  that  is  bound  to  a  portion  of  the  screen) 18 412 ws
16 528.74(when  the  window  is  mapped.   The  window  calls  Glyph::draw  on  the  root  glyph  to) 27 412 ws
16 515(refresh  the  canvas  and  Glyph::pick  to  determine  what  to  do  with  input  events) 24 385.948 ws
26.668 500.36(Figure  5.1  shows  the  Window  base  class  interface.   Window::style  sets  or) 21 412 ws
16 486.62(gets  the  style  associated  with  the  window.   Several  style  attributes  control) 21 412 ws
16 472.88(characteristics  of  a  window:   \252double_buffered\272  controls  whether  the  window  is) 19 412 ws
16 459.14(double-buffered  by  default,  \252visual\272  specifies  the  name  of  a  visual  to  use  for  the) 26 412 ws
16 445.4(window,  \252visual_id\272  specifies  the  id  of  the  desired  visual,  and  \252overlay\272  specifies) 22 412 ws
16 431.66(whether  overlay  planes  should  be  used  for  the  window.) 16 280.949 ws
390.64 37.04(5-) 2 400.636 as
403.636 37.04(1) 1 409.636 as
newpath
17.92 402.22 moveto
17.92 403.22 lineto
413.92 403.22 lineto
413.92 402.22 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
39.256 385.66(interface  Window  {) 4 122.067 ws
47.586 374.14(Window\(Glyph*  =  nil\);) 4 143.997 ws
47.586 362.62(void  style\(Style*\);) 2 124.826 ws
47.586 351.1(Style*  style\(\)  const;) 4 133.167 ws
47.586 339.58(void  display\(Display*\);) 2 145.936 ws
47.586 328.06(Display*  display\(\)  const;) 4 154.277 ws
47.586 316.54(Canvas*  canvas\(\)  const;) 4 155.956 ws
47.586 305.02(void  cursor\(Cursor*\);) 2 139.816 ws
47.586 293.5(Cursor*  cursor\(\)  const;) 4 148.157 ws
47.586 281.98(void  push_cursor\(\);) 2 133.166 ws
47.586 270.46(void  pop_cursor\(\);) 2 128.166 ws
47.586 247.42(void  place\(Coord  left,  Coord  bottom\);) 8 211.537 ws
47.586 235.9(void  align\(float  x,  float  y\);) 8 158.187 ws
47.586 224.38(Coord  left\(\)  const,  bottom\(\)  const,  width\(\)  const,  height\(\)  const;) 16 324.907 ws
47.586 201.34(void  map\(\),  unmap\(\);) 4 140.387 ws
47.586 189.82(boolean  is_mapped\(\)  const;) 4 170.976 ws
47.586 178.3(void  raise\(\),  lower\(\);) 4 135.927 ws
47.586 166.78(void  move\(Coord  left,  Coord  bottom\);) 8 212.087 ws
47.586 155.26(void  resize\(\);) 2 104.816 ws
47.586 132.22(void  receive\(const  Event&\);) 4 169.296 ws
47.586 120.7(void  grab_pointer\(Cursor*  =  nil\)  const;) 8 216.257 ws
47.586 109.18(void  ungrab_pointer\(\)  const;) 4 172.086 ws
47.586 97.6601(void  repair\(\);) 2 103.706 ws
39.256 86.1401(};  ) 2 48.1564 ws
10 /Helvetica sf
154.236 69.6201(Figure  5.1:) 2 202.036 ws
210.366 69.6201(Window  protocol) 2 284.276 ws
newpath
17.92 61.45 moveto
17.92 62.45 lineto
413.92 62.45 lineto
413.92 61.45 lineto
closepath
gsave eofill grestore
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
26.668 671.36(Window::display  sets  or  gets  the  display  that  a  window  is  mapped  on  \(or  nil  if) 28 412 ws
16 657.62(the  window  is  not  currently  mapped\).   Window::canvas  returns  the  canvas  that  the) 23 412 ws
16 643.88(window  passes  to  its  glyph  for  drawing.) 12 207.653 ws
26.668 629.24(Window::cursor  sets  or  gets  the  image  that  tracks  a  pointing  device's  position) 22 412 ws
16 615.5(when  the  it  is  inside  the  window.   Cursors  are  defined  by  two  bitmaps  and) 27 412 ws
16 601.76(a  ``hot  spot''.   The  mask  bitmap  specifies  which  pixels  are  to  be  drawn,) 25 412 ws
16 588.02(and  the  pattern  bitmap  specifies  which  pixels  are  in  foreground  color  and) 22 412 ws
16 574.28(which  are  in  background  color.   The  hot  spot  specifies  the  location  of  the) 25 412 ws
16 560.54(pointing  device  relative  to  the  cursor's  lower-left  corner.   The  foreground  and) 21 412 ws
16 546.8(background  colors  for  a  cursor  are  defined  by  the  attributes  \252pointerColor\272  and) 22 412 ws
16 533.06(\252pointerColorBackground\272  in  the  window's  style.) 8 255.641 ws
26.668 518.42(Figure  5.2  shows  the  cursor  protocol.  A  cursor  can  be  created  from  specific) 24 412 ws
16 504.68(data,  pattern  and  mask  bitmaps,  a  character  in  a  font,  or  an  index  into  the  standard) 30 412 ws
16 490.94(cursor  information  for  the  target  window  system.   If  the  cursor  is  specified  with) 25 412 ws
16 477.2(bitmaps,  the  hot  spot  is  the  origin  of  the  pattern  bitmap;  if  specified  with  a) 28 412 ws
16 463.46(character,  it  is  the  origin  of  the  character's  bitmap  in  the  font.   An  index  implies) 29 412 ws
16 449.72(both  bitmaps  as  well  as  the  hot  spot.   Specific  values  for  the  index  are  usually) 29 412 ws
16 435.98(defined  in  an  include  file.   For  example,  standard  X11  cursors  are  defined  in  the) 27 412 ws
16 422.24(file  <X11/cursorfont.h>.) 2 133.852 ws
26.668 407.6(Window::place  specifies  the  desired  screen  coordinates  for  a  window.) 16 412 ws
16 393.86(Window::align  specifies  a  desired  alignment.   The  alignment  values  are  fractions) 19 412 ws
16 380.12(that  indicate  where  the  window  should  appear  relative  to  its  coordinates  as) 22 412 ws
16 366.38(specified  by  a  call  to  Window::place.   For  example,  an  alignment  of  0.0,1.0  means) 25 412 ws
16 352.64(the  placement  specifies  the  upper-left  corner  of  the  window.   An  alignment  of) 23 412 ws
16 338.9(0.5,0.5  means  the  placement  specifies  the  center  of  the  window.   Unless  specified,) 23 412 ws
16 325.16(the  alignment  will  be  0.0,0.0,  meaning  the  placement  coordinates  specify  the) 20 412 ws
16 311.42(lower-left  corner  of  the  window.) 8 172.289 ws
26.668 296.78(Window::map  requests  the  window  to  be  mapped  onto  the  screen.   If  no  display) 25 412 ws
16 283.04(has  been  set,  then  the  session's  default  display  is  used.   Window::map  may  be) 25 412 ws
16 269.3(asynchronous\261one  cannot  assume  the  window  is  usable  immediately  after  calling) 18 412 ws
16 255.56(map.   Window::unmap  requests  that  the  window  be  removed  from  the  screen.) 21 387.436 ws
26.668 240.92(Window::raise  and  Window::lower  control  the  stacking  order  of  a  window  on) 20 412 ws
16 227.18(the  screen.   Window::raise  makes  the  window  above  all  the  other  windows  on  the) 25 412 ws
16 213.44(screen;  Window::lower  make  the  window  below  all  the  others.   These  operations) 21 412 ws
16 199.7(usually  are  neither  necessary  nor  appropriate,  as  stacking  order  should  normally) 20 412 ws
390.96 37.2(5-) 2 400.956 as
403.956 37.2(2) 1 409.956 as
newpath
16.9601 172.78 moveto
16.9601 173.78 lineto
412.96 173.78 lineto
412.96 172.78 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.2961 156.22(interface  Cursor  {) 4 115.547 ws
46.6261 144.7(Cursor\(short  x,  short  y,  const  int*  pattern,  const  int*  mask\);) 18 305.607 ws
46.6261 133.18(Cursor\(const  Bitmap*  pat,  const  Bitmap*  mask\);) 10 258.357 ws
46.6261 121.66(Cursor\(const  Font*,  int  pattern,  int  mask\);) 10 229.467 ws
46.6261 110.14(Cursor\(int  index\);) 2 123.306 ws
38.2961 98.62(};  ) 2 47.1964 ws
10 /Helvetica sf
141.886 82.1(Figure  5.2:) 2 189.686 ws
198.016 82.1(Cursor  class  interface) 4 294.706 ws
newpath
16.9601 73.93 moveto
16.9601 74.93 lineto
412.96 74.93 lineto
412.96 73.93 lineto
closepath
gsave eofill grestore
showpage
%%Page: 3 3
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 671.36(be  under  control  of  the  user  through  a  window  manager.) 18 285.941 ws
26.668 656.72(The  window  systems  delivers  input  events  to  a  particular  window,  which  in  turn) 24 412 ws
16 642.98(tries  to  find  a  handler  to  process  each  event.   Window::receive  examines  an  event,) 25 412 ws
16 629.24(handling  window  maintenance  events  internally.   For  example,  X  expose  and) 19 412 ws
16 615.5(configure  events  are  handled  directly  by  Window::receive.) 12 297.593 ws
26.668 600.86(Window::grab_pointer  takes  control  of  pointer  input  events  for  the  display.) 18 412 ws
16 587.12(Other  applications  will  not  receive  pointer  events  until  Window::ungrab_pointer) 16 412 ws
16 573.38(is  called  to  release  control.   If  a  cursor  is  passed  to  Window::grab_pointer,  it  will) 27 412 ws
16 559.64(be  used  when  the  pointer  is  outside  the  window  during  the  grab.) 22 323.297 ws
26.668 545(If  any  part  of  a  window's  canvas  has  been  damaged,  Window::repair  will) 22 412 ws
16 531.26(call  draw  on  the  root  glyph  and  perform  the  necessary  screen  update  when) 24 412 ws
16 517.52(double-buffering.   All  windows  on  a  display  will  be  repaired  automatically) 19 412 ws
16 503.78(before  blocking  for  input  from  the  display,  so  applications  usually  need  not  call) 24 412 ws
16 490.04(Window::repair  directly.  ) 4 137.645 ws
18 /Times-Bold sf
16 448.76(5.1) 3 38.5 as
51 448.76(ManagedWindow) 13 188.016 as
12 /Times-Roman sf
16 416.36(A  managed  window  specifies  information  for  a  window  manager  to  use.) 20 412 ws
16 402.62(ManagedWindow  is  an  abstract  base  class  with  four  predefined  descendants:) 18 412 ws
16 388.88(ApplicationWindow,  TopLevelWindow,  TransientWindow,  and  IconWindow.) 8 412 ws
16 375.14(An  application  should  create  one  application  window,  which  makes  information) 18 412 ws
16 361.4(about  command-line  arguments  available  to  a  session  manager,  if  present  on  the) 22 412 ws
16 347.66(system.   After  the  application  window,  normal  windows  are  top-level.   A  top-level) 22 412 ws
16 333.92(window  can  have  a  ``group  leader'',  which  is  typically  the  application  window.   A) 25 412 ws
16 320.18(window  manager  may  allow  quick  control  of  all  windows  with  the  same  group) 24 412 ws
16 306.44(leader,  such  as  when  iconifying  or  deiconifying.) 12 247.289 ws
26.668 291.8(A  transient  window  is  often  treated  specially  by  window  managers.   It  may  be) 25 412 ws
16 278.06(decorated  differently  \(or  not  at  all\),  or  automatically  unmapped  when  the  main) 22 412 ws
16 264.32(window  is  iconified.   Transient  windows  are  used  for  temporary  controls,  such  as) 23 412 ws
16 250.58(dialog  boxes,  but  not  for  unmanaged  windows  such  as  popups  or  pulldowns.   A) 25 412 ws
16 236.84(transient  is  usually  associated  with  another  managed  window.) 14 312.629 ws
26.668 222.2(An  icon  window  is  a  window  that  is  mapped  when  its  associated  window) 24 412 ws
16 208.46(is  iconified  and  unmapped  when  its  associated  window  is  deiconified.   Calling) 21 412 ws
16 194.72(Window::map  on  an  icon  window  will  therefore  bind  it  to  the  window  system,  but) 26 412 ws
16 180.98(will  not  map  it  on  the  screen.) 12 155.658 ws
26.668 166.34(Figure  5.3  shows  the  ManagedWindow  protocol.  Most  of  the  operations  on) 20 412 ws
16 152.6(a  managed  window  set  or  return  information  associated  with  the  window.   In) 23 412 ws
16 138.86(addition,  ManagedWindow  interprets  additional  attributes  in  its  style  inherited) 16 412 ws
16 125.12(from  the  base  class.   The  attribute  \252name\272  specifies  a  string  name  for  the) 25 412 ws
16 111.38(window  manager  to  use,  \252iconName\272  specifies  a  string  for  the  window's  icon,) 22 412 ws
16 97.6401(\252geometry\272  specifies  the  desired  geometry,  and  \252iconGeometry\272  specifies  the) 16 412 ws
16 83.9001(desired  geometry  for  the  window's  icon.   Geometry  specifications  are  strings  of) 21 412 ws
16 70.1601(the  form  ``WxH+X+Y''  where  W  is  the  width,  H  the  height,  X  the  left  corner,  and) 30 412 ws
390.96 37.2(5-) 2 400.956 as
403.956 37.2(3) 1 409.956 as
showpage
%%Page: 4 4
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 422.93(Y  the  top  corner  of  the  window.   Either  the  position  or  the  size  may  be  omitted,) 31 412 ws
16 409.19(and  the  position  can  use  ``\261''  instead  of  ``+''  to  denote  distance  from  the  opposite) 28 412 ws
16 395.45(of  the  display  to  the  opposite  side  of  the  window.   For  example,  a  \261X  value) 29 412 ws
16 381.71(specifies  that  the  right  side  of  the  window  should  be  a  distance  of  X  from  the  right) 32 412 ws
16 367.97(edge  of  the  screen.) 6 105.965 ws
26.668 353.33(ManagedWindow::icon_bitmap  and  ManagedWindow::icon_mask  specify  two) 8 412 ws
16 339.59(bitmaps  to  use  to  draw  an  icon.   The  mask  defines  the  area  to  be  drawn  and  the) 33 412 ws
16 325.85(bitmap  defines  the  foreground  and  background  areas.   Pixels  that  correspond  to  a) 23 412 ws
16 312.11(one  in  the  bitmap  and  a  one  in  the  mask  are  drawn  with  the  foreground  color.) 30 412 ws
16 298.37(Pixels  that  correspond  to  a  zero  in  the  bitmap  and  a  one  in  the  mask  are  draw  with) 34 412 ws
16 284.63(the  background  color.   Pixels  that  correspond  to  a  zero  in  the  mask  are  not  drawn.) 29 406.756 ws
26.668 269.99(ManagedWindow::icon  specifies  a  second  window  to  map  when  the  first) 18 412 ws
16 256.25(window  is  iconified.   Using  a  window  as  an  icon  overrides  the  other  icon) 25 412 ws
16 242.51(information.   Therefore,  it  does  not  make  sense  to  use  ManagedWindow::icon) 19 412 ws
16 228.77(in  conjunction  with  icon_bitmap,  icon_mask,  or  the  \252iconName\272  and) 16 412 ws
16 215.03(\252iconGeometry\272  attributes.) 2 145.972 ws
26.668 200.39(ManagedWindow::iconic  specifies  the  initial  state  of  a  window.   If  iconic  is  true,) 23 412 ws
16 186.65(mapping  a  window  will  actually  map  its  icon  instead.   ManagedWindow::iconic) 19 412 ws
16 172.91(need  not  be  called  directly  by  an  application;  it  is  called  automatically  if  specified) 26 412 ws
16 159.17(by  user  customization  information.) 6 183.989 ws
26.668 144.53(ManagedWindow::iconify  requests  the  window  be  unmapped  and  the  window's) 16 412 ws
16 130.79(icon  be  mapped  to  the  screen.   ManagedWindow::deiconify  reverses  the  operation,) 19 412 ws
16 117.05(unmapping  the  icon  and  mapping  the  original  window.   It  does  not  make  sense  to) 27 412 ws
16 103.31(iconify  or  deiconify  an  icon  window.) 10 193.973 ws
26.668 88.67(ManagedWindow::focus_event  specifies  handlers  for  the  window  receiving  and) 14 412 ws
16 74.93(losing  keyboard  focus  from  the  window  manager.   ManagedWindow::wm_delete) 15 412 ws
16 61.19(specifies  a  handler  for  a  request  from  the  window  manager  to  delete  the  window.) 26 412 ws
390.96 37.2(5-) 2 400.956 as
403.956 37.2(4) 1 409.956 as
newpath
15.04 663.34 moveto
15.04 664.34 lineto
411.04 664.34 lineto
411.04 663.34 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
36.376 646.78(interface  ManagedWindow  :  Window  {) 8 204.777 ws
44.706 635.26(void  icon_bitmap\(Bitmap*\);) 2 164.186 ws
44.706 623.74(Bitmap*  icon_bitmap\(\)  const;) 4 172.526 ws
44.706 612.22(void  icon_mask\(Bitmap*\);) 2 158.066 ws
44.706 600.7(Bitmap*  icon_mask\(\)  const;) 4 166.407 ws
44.706 584.18(void  icon\(ManagedWindow*\);) 2 174.746 ws
44.706 572.66(ManagedWindow*  icon\(\)  const;) 4 183.086 ws
44.706 549.62(void  iconic\(boolean\);) 2 136.406 ws
44.706 538.1(boolean  iconic\(\)  const;) 4 144.747 ws
44.706 526.58(void  iconify\(\);) 2 103.606 ws
44.706 515.06(void  deiconify\(\);) 2 114.726 ws
44.706 492.02(void  focus_event\(Handler*  in,  Handler*  out\);) 8 239.787 ws
44.706 480.5(void  wm_delete\(Handler*\);) 2 162.516 ws
36.376 468.98(};  ) 2 45.2764 ws
10 /Helvetica sf
116.341 452.46(Figure  5.3:) 2 164.141 ws
172.471 452.46(ManagedWindow  class  interface) 4 316.411 ws
newpath
15.04 444.29 moveto
15.04 445.29 lineto
411.04 445.29 lineto
411.04 444.29 lineto
closepath
gsave eofill grestore
showpage
%%Page: 5 5
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 399.13(If  the  handler  is  nil  \(which  is  the  initial  value\),  then  the  response  to  this  event  will) 32 412 ws
16 385.39(be  to  call  Session::quit.) 6 128.009 ws
26.668 370.75(Figure  5.4  shows  the  operations  on  the  ManagedWindow  subclasses.) 16 412 ws
16 357.01(ApplicationWindow  and  IconWindow  provide  no  additional  operations  beyond  a) 16 412 ws
16 343.27(constructor.   TopLevelWindow  provides  an  operation  to  set  or  return  its  group) 21 412 ws
16 329.53(leader.   TransientWindow  is  a  subclass  to  TopLevelWindow  that  can  additionally) 19 412 ws
16 315.79(be  associated  with  a  primary  window  with  TransientWindow::transient_for.  ) 16 382.948 ws
18 /Times-Bold sf
16 274.51(5.2) 3 38.5 as
51 274.51(PopupWindow) 11 166.038 as
12 /Times-Roman sf
16 242.11(A  popup  window  is  mapped  directly  to  a  screen  without  window  manager) 22 412 ws
16 228.37(interaction  \(or  knowledge\).   In  the  X   Window  System,  a  popup  window  will) 24 412 ws
16 214.63(override  the  normal  redirection  of  map  requests  to  window  managers.   Popups  on) 23 412 ws
16 200.89(X  also  will  request  that  the  pixels  under  the  popup  be  saved  to  avoid  a  subsequent) 30 412 ws
16 187.15(exposure  when  the  popup  is  unmapped.) 10 205.973 ws
26.668 172.51(Popups  should  only  be  used  for  temporary  windows,  such  as  popup  or  pulldown) 24 412 ws
16 158.77(menus.   Because  they  do  not  go  through  the  window  manager,  popups  should  be) 25 412 ws
16 145.03(placed  explicitly.   Here  is  an  example  of  using  a  popup  that  appears  below  a) 27 412 ws
16 131.29(menubar,  aligning  the  top  of  the  popup  to  the  lower  left  corner  of  the  menubar:) 28 394.936 ws
10 /Helvetica sf
32.66 112.81(void  pulldown\(Window*  menubar,  Glyph*  g\)  {) 10 231.621 ws
40.99 101.29(PopupWindow*  popup  =  new  PopupWindow\(g\);) 8 251.921 ws
49.32 89.77(popup->place\(menubar->left\(\),  menubar\(\)->bottom\(\)\);) 2 286.34 ws
49.32 78.25(popup->align\(0.0,  1.0\);) 2 150.21 ws
49.32 66.73(popup->map\(\);  ) 2 117.96 ws
12 /Times-Roman sf
390.96 37.2(5-) 2 400.956 as
403.956 37.2(5) 1 409.956 as
newpath
16.9601 669.1 moveto
16.9601 670.1 lineto
412.96 670.1 lineto
412.96 669.1 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.2961 652.54(interface  ApplicationWindow  :  ManagedWindow  {) 8 255.607 ws
46.6261 641.02(ApplicationWindow\(Glyph*\);) 26 170.546 as
38.2961 629.5(};) 2 44.416 as
38.2961 606.46(interface  TopLevelWindow  :  ManagedWindow  {) 8 247.827 ws
46.6261 594.94(TopLevelWindow\(Glyph*\);) 23 162.766 as
46.6261 583.42(void  group_leader\(ManagedWindow*\);) 2 217.246 ws
46.6261 571.9(ManagedWindow*  group_leader\(\)  const;) 4 225.586 ws
38.2961 560.38(};) 2 44.416 as
38.2961 537.34(interface  TransientWindow  :  TopLevelWindow  {) 8 247.817 ws
46.6261 525.82(TransientWindow\(Glyph*\);) 24 163.316 as
46.6261 514.3(void  transient_for\(ManagedWindow*\);) 2 213.906 ws
46.6261 502.78(void  ManagedWindow*  transient_for\(\)  const;) 6 243.367 ws
38.2961 491.26(};) 2 44.416 as
38.2961 468.22(interface  IconWindow  :  ManagedWindow  {) 8 225.597 ws
46.6261 456.7(IconWindow\(Glyph*\);) 19 140.536 as
38.2961 445.18(};  ) 2 47.1964 ws
10 /Helvetica sf
125.486 428.66(Figure  5.4:) 2 173.286 ws
181.616 428.66(ManagedWindow  subclasses) 2 311.106 ws
newpath
16.9601 420.49 moveto
16.9601 421.49 lineto
412.96 421.49 lineto
412.96 420.49 lineto
closepath
gsave eofill grestore
showpage
%%Page: 6 6
90.05 36.94 translate
0 0 0 setrgbcolor
10 /Helvetica sf
32.66 672.32(}) 1 36 as
18 /Times-Bold sf
16 617.56(5.3) 3 38.5 as
51 617.56(Display) 7 109.014 as
12 /Times-Roman sf
16 585.16(A  ) 2 29.0449 ws
12 /Times-Italic sf
29.0449 585.16(display) 7 63.7129 as
12 /Times-Roman sf
63.7129 585.16(  is  the  unit  of  window  system  control;  typically  it  consists  of  a  single) 26 412 ws
16 571.42(screen,  keyboard,  and  a  mouse  or  other  pointing  device.   Application  objects) 21 412 ws
16 557.68(typically  need  not  deal  directly  with  a  display;  the  functionality  of  the  window) 24 412 ws
16 543.94(class  is  normally  sufficient.) 6 147.989 ws
26.668 529.3(Figure  5.5  shows  the  display  class  interface.   Display::open  is  a  static  member) 23 412 ws
16 515.56(function  that  opens  a  connection  to  the  display  with  the  given  name.   The) 25 412 ws
16 501.82(interpretation  of  a  display  name  is  system-dependent.   On  X,  the  name  is) 23 412 ws
12 /Times-Italic sf
16 488.08(host:number) 11 76.66 as
12 /Times-Roman sf
76.66 488.08(  where  ) 4 112.96 ws
12 /Times-Italic sf
112.96 488.08(host) 4 132.964 as
12 /Times-Roman sf
132.964 488.08(  is  a  machine's  hostname  and  ) 12 279.892 ws
12 /Times-Italic sf
279.892 488.08(number) 6 316.552 as
12 /Times-Roman sf
316.552 488.08(  is  the  index  for  the) 10 412 ws
16 474.34(display  connected  to  that  host  \(typically  0\).   If  successful,  Display::open  returns) 21 412 ws
16 460.6(a  pointer  to  a  display  object.   If  not  successful,  it  returns  nil.   Display::close) 26 412 ws
16 446.86(terminates  the  connection.) 4 142.313 ws
26.668 432.22(Display::width  and  Display::height  return  the  dimensions  in  coordinates  of) 16 412 ws
16 418.48(the  display's  current  screen.   Display::a_width  and  Display::a_height  return  the) 17 412 ws
16 404.74(dimensions  in  points  \(72  points  =  one  inch\).) 14 227.442 ws
390.96 37.2(5-) 2 400.956 as
403.956 37.2(6) 1 409.956 as
newpath
17.2 383.26 moveto
17.2 384.26 lineto
413.2 384.26 lineto
413.2 383.26 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.536 366.7(interface  Display  {) 4 118.567 ws
46.866 355.18(static  Display*  open\(const  String&\);) 6 203.587 ws
46.866 343.66(static  Display*  open\(\);) 4 144.117 ws
46.866 332.14(virtual  void  close\(\);) 4 130.217 ws
46.866 315.62(virtual  Coord  width\(\)  const;) 6 165.787 ws
46.866 304.1(virtual  Coord  height\(\)  const;) 6 169.687 ws
46.866 292.58(virtual  Coord  a_width\(\)  const;) 6 176.907 ws
46.866 281.06(virtual  Coord  a_height\(\)  const;) 6 180.807 ws
46.866 269.54(int  to_pixels\(Coord\)  const;) 4 163.017 ws
46.866 258.02(Coord  to_coord\(int\)  const;) 4 162.467 ws
46.866 241.5(virtual  void  set_screen\(int\);) 4 166.347 ws
46.866 224.98(virtual  void  style\(Style*\);) 4 153.557 ws
46.866 213.46(virtual  Style*  style\(\)  const;) 6 161.897 ws
46.866 196.94(virtual  void  repair\(\);) 4 132.437 ws
46.866 185.42(virtual  void  flush\(\);) 4 127.997 ws
46.866 173.9(virtual  void  sync\(\)) 4 124.657 ws
46.866 157.38(virtual  void  ring_bell\(int\);) 4 155.227 ws
46.866 145.86(virtual  void  set_key_click\(int\);) 4 176.896 ws
46.866 134.34(virtual  void  set_auto_repeat\(boolean\);) 4 214.726 ws
46.866 122.82(virtual  void  set_pointer_feedback\(int  thresh,  int  scale\);) 10 285.857 ws
46.866 111.3(virtual  void  move_pointer\(Coord  x,  Coord  y\);) 10 243.037 ws
38.536 99.7801(};) 2 44.656 as
10 /Helvetica sf
139.346 83.2601(Figure  5.5:) 2 187.146 ws
195.476 83.2601(Display  class  interface.) 4 297.726 ws
newpath
17.2 75.09 moveto
17.2 76.09 lineto
413.2 76.09 lineto
413.2 75.09 lineto
closepath
gsave eofill grestore
showpage
%%Page: 7 7
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
26.668 671.36(Display::to_pixels  and  Display::to_coord  convert  between  coordinates  and) 12 412 ws
16 657.62(pixels.   The  conversion  is  a  function  of  the  ) 17 231.582 ws
12 /Times-Italic sf
231.582 657.62(dpi) 3 246.918 as
12 /Times-Roman sf
246.918 657.62(  attribute,  which  is  75  by  default.) 12 412 ws
16 643.88(One  coordinate  unit  length  is  a  printer's  point,  defined  as  72/) 20 308.297 ws
12 /Times-Italic sf
308.297 643.88(dpi) 3 323.633 as
12 /Times-Roman sf
323.633 643.88(  pixels.) 2 358.301 ws
26.668 629.24(Display::set_screen  sets  the  current  screen  to  use  for  display  operations.) 18 412 ws
16 615.5(Initially,  current  screen  is  set  to  0.) 12 179.31 ws
26.668 600.86(Display::repair  calls  Window::repair  for  each  window  on  the  display  that  has) 20 412 ws
16 587.12(a  canvas  with  damage.   It  is  not  necessary  to  call  Display::repair  directly,  as) 25 412 ws
16 573.38(windows  will  automatically  be  repaired  before  blocking  for  input  events.) 18 365.945 ws
26.668 558.74(Display::flush  and  Display::sync  are  used  to  synchronize  with  the  window) 18 412 ws
16 545(system.   Display::flush  repairs  all  damaged  windows  on  the  display  and  ensures) 21 412 ws
16 531.26(that  any  pending  requests  have  been  sent  to  the  window  system.   Display::sync  is) 25 412 ws
16 517.52(the  same  as  Display::flush,  but  additionally  waits  for  an  acknowledgement  from) 20 412 ws
16 503.78(the  window  system.) 4 111.665 ws
26.668 489.14(Display::ring_bell  sounds  the  workstation's  bell  at  a  specified  volume.   The) 19 412 ws
16 475.4(parameter  should  be  between  0  and  100,  where  0  is  silent  and  100  is  the  loudest) 30 412 ws
16 461.66(possible  bell.) 2 79.3364 ws
26.668 447.02(The  operations  set_key_click,  set_auto_repeat,  and  set_pointer_feedback) 10 412 ws
16 433.28(modify  the  key  click  volume,  the  flag  determining  whether  keys  should  repeat,) 22 412 ws
16 419.54(and  the  pointer  interpretation  parameters,  respectively.   Display::move_pointer) 13 412 ws
16 405.8(changes  the  position  of  the  input  pointer.   This  operation  can  have  surprising) 23 412 ws
16 392.06(effects  to  the  user  and  should  generally  be  avoided.) 16 262.277 ws
390.96 37.2(5-) 2 400.956 as
403.956 37.2(7) 1 409.956 as
showpage
%%Trailer
end restore
%%Pages: 7
%!PS-Adobe-2.0
%%Creator: ./ch6.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
16 662.72(Chapter  6) 2 119.321 ws
16 625.76(Rendering) 9 124 as
12 /Times-Roman sf
16 597.44(This  chapter  describes  the  InterViews  classes  for  drawing  on  the  screen  and  on  a) 26 412 ws
16 583.7(printer.   The  two  primary  classes  are  Canvas,  which  represents  an  area  on  the) 25 412 ws
16 569.96(screen,  and  Printer,  which  sends  output  suitable  for  printing  to  an  output  stream.) 24 412 ws
16 556.22(The  drawing  classes  are  intended  to  be  simple  and  resolution-independent.   The) 21 412 ws
16 542.48(programming  interface  resembles  the  PostScript  drawing  operations.) 12 345.617 ws
26.668 527.84(Printer  is  a  subclass  of  Canvas,  and  as  such  implements  the  same  drawing) 24 412 ws
16 514.1(operations  as  Canvas.   However,  it  is  possible  that  glyphs  may  use  other  rendering) 25 412 ws
16 500.36(operations  than  those  provided  by  Canvas,  such  as  for  3D.   In  this  case,  glyphs) 27 412 ws
16 486.62(should  provide  distinct  draw  and  print  operations.   If  a  glyph  does  not  need) 25 412 ws
16 472.88(operations  other  than  those  provided  by  Canvas  then  the  glyph  can  rely  on  default) 26 412 ws
16 459.14(implementation  of  drawing  on  a  printer,  which  just  calls  the  canvas-directed  draw) 22 412 ws
16 445.4(with  the  printer  as  the  target.  ) 12 156.978 ws
18 /Times-Bold sf
16 404.12(6.1) 3 38.5 as
51 404.12(Graphics  Attributes) 2 205.494 ws
12 /Times-Roman sf
16 371.72(InterViews  provides  classes  that  represent  graphics  attributes  such  as  colors) 18 412 ws
16 357.98(and  fonts.   The  instances  are  all  sharable,  meaning  the  classes  are  derived) 23 412 ws
16 344.24(from  Resource.   The  objects  are  also  display-independent,  meaning  they  will) 19 412 ws
16 330.5(correspond  to  several  underlying  objects  in  applications  that  run  on  multiple) 20 412 ws
16 316.76(displays.   For  example,  a  single  InterViews  color  object  might  have  different  pixel) 23 412 ws
16 303.02(values  on  different  displays.  ) 8 154.313 ws
14 /Times-Bold sf
16 276.62(6.1.1) 5 44 as
56 276.62(Brush) 5 92.568 as
12 /Times-Roman sf
16 256.18(A  brush  defines  the  line  thickness  and  line  style  for  drawing  operations.   The) 25 412 ws
16 242.44(effect  of  these  operations  is  as  if  a  line  segment  equal  in  length  to  the) 28 412 ws
16 228.7(brush's  width  were  dragged  along  an  infinitely  thin  path  between  the  specified) 22 412 ws
16 214.96(coordinates.   At  each  point  along  the  path  the  brush  is  angled  perpendicular  to  the) 27 412 ws
16 201.22(path.   As  a  special  case,  a  brush  width  of  zero  specifies  a  minimal-width  line.) 27 412 ws
16 187.48(Many  devices  can  render  minimal-width  lines  more  quickly  than  wide  lines,  but) 22 412 ws
16 173.74(the  resulting  display  may  vary  slightly  across  devices.   A  solid  brush  style  paints) 25 412 ws
16 160(all  pixels  along  the  path  with  a  single  color.   A  dashed  brush  defines  alternating) 27 412 ws
16 146.26(foreground  and  background  segments,  measured  along  the  length  of  the  path.) 20 412 ws
16 132.52(Foreground  segments  are  painted,  while  background  segments  are  not.) 16 354.605 ws
26.668 117.88(Figure  6.1  shows  the  Brush  class  interface.   The  first  constructor  creates  a  solid) 25 412 ws
16 104.14(brush  of  the  given  width.   The  second  constructor  creates  a  brush  with  the  given) 27 412 ws
16 90.4(width  and  line  style.   The  pattern  is  an  array  of  integers  that  specifies  the  length  of) 31 412 ws
16 76.66(successive  foreground  and  background  segments.   Even-numbered  array  indices) 15 412 ws
16 62.92(\(starting  from  0\)  specify  the  length  of  foreground  segments;  odd-numbered) 18 412 ws
388.72 38.96(6-) 2 398.716 as
401.716 38.96(1) 1 407.716 as
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 565.21(indices  specify  background  segments.   The  ) 11 231.65 ws
10 /Helvetica sf
231.65 565.21(count) 5 256.11 as
12 /Times-Roman sf
256.11 565.21(  is  the  number  of  entries  in  the) 14 412 ws
16 551.47(array.   The  count  can  be  zero,  which  specifies  a  solid  brush.   The  last  constructor) 28 412 ws
16 537.73(defines  a  brush  with  a  given  width  and  a  style  specified  by  a  bit  vector.   The) 31 412 ws
16 523.99(least  significant  16  bits  of  ) 10 151.537 ws
10 /Helvetica sf
151.537 523.99(pattern) 7 182.667 as
12 /Times-Roman sf
182.667 523.99(  are  interpreted  as  a  bit  pattern,  with  one  bits) 18 412 ws
16 510.25(specifying  foreground  segments  and  zero  bits  specifying  background  segments.  ) 18 400.6 ws
14 /Times-Bold sf
16 483.85(6.1.2) 5 44 as
56 483.85(Color) 5 90.216 as
12 /Times-Roman sf
16 463.41(A  color  object  defines  an  output  color,  which  is  specified  by  a  mix  of  RGB  \(red,) 30 412 ws
16 449.67(green,  and  blue\)  intensities,  and  an  alpha  value  for  blending.   Figure  6.2  shows  the) 27 412 ws
16 435.93(Color  class  interface.   RGB  and  alpha  values  are  represented  as  floating  point) 23 412 ws
16 422.19(numbers  between  0  and  1,  where  1  is  full  intensity  \(or  visibility  in  the  case  of) 30 412 ws
16 408.45(alpha\).   A  color  object  is  created  with  the  RGB  intensities,  an  alpha  value  \(default) 27 412 ws
16 394.71(is  1.0\),  and  a  drawing  operation.   A  color  drawing  operation  need  be  specified) 25 412 ws
16 380.97(only  on  rare  occasions.   The  default  operation,  Copy) 15 270.988 ws
12 /Helvetica sf
270.988 380.97(,) 1 274.324 as
12 /Times-Roman sf
274.324 380.97(  blends  the  color  in  directly.) 10 412 ws
16 367.23(The  Xor  operation  uses  a  pixel  value  computed  by  taking  the  exclusive-or  of  the) 26 412 ws
16 353.49(color  and  the  existing  pixel  value.   Xor  is  only  useful  on  a  monochrome  system.) 27 398.464 ws
26.668 338.85(Color::lookup  returns  the  color  with  the  given  name  as  defined  on  the  given) 24 412 ws
16 325.11(display  or  nil  if  the  name  is  not  defined.   Color::distinguished  determines  if  two) 25 412 ws
16 311.37(colors  are  distinct  on  a  particular  display.   A  common  use  of  Color::distinguished) 23 412 ws
16 297.63(is  to  check  if  a  highlighting  color  is  distinct  from  foreground  and  background) 24 412 ws
16 283.89(colors.   Color::intensities  returns  the  RGB  values  for  a  given  color  on  a  given) 25 412 ws
16 270.15(display.   Color::brightness  creates  a  new  color   that  is  brighter  or  darker  than) 24 412 ws
16 256.41(the  given  color  by  a  certain  adjustment.   If  the  adjust  parameter  is  positive,  it) 27 412 ws
16 242.67(indicates  the  new  intensity  should  be  the  given  fraction  of  the  distance  between) 24 412 ws
16 228.93(the  current  intensity  and  full  intensity.   If  the  parameter  is  negative,  its  absolute) 25 412 ws
16 215.19(value  specifies  a  distance  to  zero  intensity.) 12 220.961 ws
26.668 200.55(InterViews  automatically  translates  an  RGB  specification  to  the  appropriate) 16 412 ws
16 186.81(pixel  value  for  a  window.   This  approach  hides  the  system-dependent  details  of) 23 412 ws
16 173.07(color  management  from  applications,  making  them  more  portable  and  giving) 18 412 ws
16 159.33(greater  flexibility  to  graphics  system  implementors.   Under  the  X  Window  System,) 21 412 ws
16 145.59(color-intensive  applications  might  not  find  the  default  color  implementation) 16 412 ws
16 131.85(acceptable.   To  assist  such  applications,  InterViews  provides  a  way  to  specify  an) 23 412 ws
16 118.11(X  visual,  either  on  the  command-line  with  the  ``-visual''  flag,  or  with  a  ``visual'') 26 412 ws
16 104.37(X  resource  defined  to  the  desired  visual  type.   For  example,  on  displays  that) 25 412 ws
16 90.6301(support  TrueColor  \(which  means  pixel  values  can  be  computed  directly  from) 20 412 ws
16 76.8901(RGB  values\)  but  for  which  the  default  visual  is  not  TrueColor,  a  user  could  run  an) 30 412 ws
16 63.1501(application  with  ``-visual  TrueColor''  or  define  ``*app*visual:TrueColor''  in  the) 16 412 ws
388.72 38.96(6-) 2 398.716 as
401.716 38.96(2) 1 407.716 as
newpath
16 673.9 moveto
16 674.9 lineto
412 674.9 lineto
412 673.9 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.336 657.34(interface  Brush  :  Resource  {) 8 161.837 ws
45.666 645.82(Brush\(Coord  width\);) 2 134.576 ws
45.666 634.3(Brush\(int*  pattern,  int  count,  Coord  width\);) 10 231.857 ws
45.666 622.78(Brush\(int  pattern,  Coord  width\);) 6 184.607 ws
37.336 611.26(};  ) 2 46.2364 ws
10 /Helvetica sf
142.866 594.74(Figure  6.1:) 2 190.666 ws
198.996 594.74(Brush  class  interface) 4 291.806 ws
newpath
16 586.57 moveto
16 587.57 lineto
412 587.57 lineto
412 586.57 lineto
closepath
gsave eofill grestore
12 /Times-Roman sf
389.04 39.12(6-) 2 399.036 as
402.036 39.12(2) 1 408.036 as
showpage
%%Page: 3 3
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 413.53(application  defaults  file.  ) 6 135.317 ws
14 /Times-Bold sf
16 387.13(6.1.3) 5 44 as
56 387.13(Font) 4 84 as
12 /Times-Roman sf
16 366.69(A  font  defines  a  mapping  between  character  codes  and  their  appearance  on  the) 24 412 ws
16 352.95(screen.   PSFont  is  a  subclass  of  Font  that  uses  PostScript  metrics  for  character) 25 412 ws
16 339.21(widths,  if  the  metrics  are  available  on  the  system.   Figure  6.3  shows  the  Font  and) 29 412 ws
16 325.47(PSFont  class  interfaces.   The  Font  constructor  is  given  the  full  name  of  the  font) 27 412 ws
16 311.73(and  a  scaling  factor.   If  the  font  is  used  on  a  display  that  does  not  recognize  the) 33 412 ws
16 297.99(name,  then  a  default  font  will  be  used.   Font::find  can  be  used  to  compute  a  valid) 31 412 ws
16 284.25(fullname  for  a  font  from  a  given  font  family  name,  desired  point  size,  and  font) 28 412 ws
16 270.51(style  \(such  as  italic  or  bold\).   If  a  font  is  available  that  matches  all  but  the  point) 33 412 ws
16 256.77(size,  Font::find  will  return  the  font  with  ) 14 214.938 ws
10 /Helvetica sf
214.938 256.77(scale) 5 238.278 as
12 /Times-Roman sf
238.278 256.77(  set  to  the  ratio  of  the  desired  point) 16 412 ws
16 243.03(size  to  the  actual  point  size.) 10 148.65 ws
26.668 228.39(Font::name  returns  the  full  name  of  the  font.   Font::encoding  returns  the) 21 412 ws
16 214.65(character  set  identification,  such  as  ``iso8859''  for  ISO  Latin.   Font::size  returns) 21 412 ws
16 200.91(the  point  size  of  the  font.) 10 135.99 ws
26.668 186.27(Font::font_bbox,  Font::char_bbox,  and  Font::string_bbox  return  information) 10 412 ws
16 172.53(about  the  overall  font,  a  specific  character  in  the  font,  or  a  string  of  characters.) 28 412 ws
16 158.79(Each  operation  returns  a  FontBoundingBox  object,  which  has  operations  to  return) 20 412 ws
16 145.05(detailed  information.) 2 116.656 ws
26.668 130.41(FontBoundingBox::ascent  returns  the  extent  above  the  font's  baseline;) 14 412 ws
16 116.67(FontBoundingBox::descent  returns  the  extent  below  the  font's  baseline.) 14 412 ws
16 102.93(FontBoundingBox::left_bearing  returns  the  left  edge  of  the  bitmap  associated) 16 412 ws
16 89.1899(with  a  character;  FontBoundingBox::right_bearing  returns  the  right  edge.) 14 367.96 ws
26.668 74.5499(Font::width  on  a  single  character  returns  the  width  of  a  character's  bitmap) 22 412 ws
16 60.8099(and  on  a  string  it  returns  the  sum  of  the  widths  of  the  individual  characters.) 28 412 ws
388.72 38.96(6-) 2 398.716 as
401.716 38.96(3) 1 407.716 as
389.04 39.12(6-) 2 399.036 as
402.036 39.12(3) 1 408.036 as
newpath
16 671.98 moveto
16 672.98 lineto
412 672.98 lineto
412 671.98 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.336 655.42(typedef  float  ColorIntensity;) 4 158.507 ws
37.336 643.9(typedef  unsigned  int  ColorOp;) 6 169.627 ws
37.336 620.86(interface  Color  :  Resource  {) 8 159.607 ws
45.666 609.34(enum  {  Copy,  Xor  };) 8 132.937 ws
45.666 597.82(Color\() 6 72.8861 as
53.996 586.3(ColorIntensity  r,  ColorIntensity  g,  ColorIntensity  b,) 10 274.077 ws
53.996 574.78(float  alpha  =  1.0,  ColorOp  =  Copy) 12 202.967 ws
45.666 563.26(\);) 2 51.776 as
45.666 551.74(Color\(const  Color&,  float  alpha  =  1.0,  ColorOp  =  Copy\);) 16 290.767 ws
45.666 540.22(static  const  Color*  lookup\(Display*,  const  String&  name\);) 12 297.417 ws
45.666 528.7(static  const  Color*  lookup\(Display*,  const  char*\);) 10 260.177 ws
45.666 517.18(boolean  distinguished\(Display*,  Color*\);) 4 221.836 ws
45.666 505.66(void  intensities\() 2 114.576 ws
53.996 494.14(Display*,  ColorIntensity&  r,  ColorIntensity&  g,  ColorIntensity&  b) 12 333.536 ws
45.666 482.62(\)  const;) 2 78.4564 ws
45.666 471.1(const  Color*  brightness\(float  adjust\)  const;) 8 233.517 ws
37.336 459.58(};  ) 2 46.2364 ws
10 /Helvetica sf
143.981 443.06(Figure  6.2:) 2 191.781 ws
200.111 443.06(Color  class  interface) 4 290.691 ws
newpath
16 434.89 moveto
16 435.89 lineto
412 435.89 lineto
412 434.89 lineto
closepath
gsave eofill grestore
showpage
%%Page: 4 4
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 242.05(Font::index  returns  the  index  of  the  character  in  a  string  that  would  be  ) 26 387.54 ws
10 /Helvetica sf
387.54 242.05(offset) 6 412 as
12 /Times-Roman sf
16 228.31(coordinates  from  the  left  if  the  string  were  displayed.   If  ) 21 310.113 ws
10 /Helvetica sf
310.113 228.31(between) 7 347.913 as
12 /Times-Roman sf
347.913 228.31(  is  false,  the) 6 412 ws
16 214.57(index  of  the  character  that  contains  ) 12 194.342 ws
10 /Helvetica sf
194.342 214.57(offset) 6 218.802 as
12 /Times-Roman sf
218.802 214.57(  is  returned;  otherwise  the  index  of  the) 14 412 ws
16 200.83(character  following  the  between-character  space  that  is  nearest  ) 16 328.419 ws
10 /Helvetica sf
328.419 200.83(offset) 6 352.879 as
12 /Times-Roman sf
352.879 200.83(  is  returned.) 4 412 ws
16 187.09(In  either  case  a  negative  offset  will  return  an  index  of  zero  and  an  offset  beyond) 30 412 ws
16 173.35(the  end  of  the  string  will  return  an  index  equal  to  the  length  of  the  string.  ) 32 368.297 ws
14 /Times-Bold sf
16 146.95(6.1.4) 5 44 as
56 146.95(Transformer) 11 133.756 as
12 /Times-Roman sf
16 126.51(A  transformer  object  represents  a  3x2  matrix  for  use  in  translating  2D  coordinates.) 24 412 ws
16 112.77(Figure  6.4  shows  the  Transformer  class  interface.   The  transformer  constructor) 19 412 ws
16 99.0299(with  no  parameters  creates  an  identity  matrix.   The  other  constructor  takes  the) 23 412 ws
16 85.2899(explicit  matrix  values  as  parameters.   Transformer::identity  returns  whether  the) 17 412 ws
16 71.5499(matrix  is  currently  the  identity  matrix.) 10 199.325 ws
388.72 38.96(6-) 2 398.716 as
401.716 38.96(4) 1 407.716 as
389.04 39.12(6-) 2 399.036 as
402.036 39.12(4) 1 408.036 as
newpath
16 676.78 moveto
16 677.78 lineto
412 677.78 lineto
412 676.78 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.336 660.22(interface  FontBoundingBox  {) 4 164.077 ws
45.666 648.7(Coord  left_bearing\(\)  const,  right_bearing\(\)  const;) 8 261.307 ws
45.666 637.18(Coord  width\(\)  const,  ascent\(\)  const,  descent\(\)  const;) 12 277.417 ws
45.666 625.66(Coord  font_ascent\(\)  const,  font_descent\(\)  const;) 8 259.657 ws
37.336 614.14(};) 2 43.456 as
37.336 597.62(typedef  long  FontCharCode;) 4 162.957 ws
37.336 581.1(interface  Font  :  Resource  {) 8 155.727 ws
45.666 569.58(Font\(const  String&,  float  scale  =  1.0\);) 10 210.467 ws
45.666 558.06(Font\(const  char*  fullname,  float  scale  =  1.0\);) 12 241.587 ws
45.666 546.54(static  boolean  find\() 4 129.597 ws
53.996 535.02(const  char*  family,  int  size,  const  char*  style,) 14 251.287 ws
53.996 523.5(const  char*&  fullname,  float&  scale) 8 208.507 ws
45.666 511.98(\);) 2 51.776 as
45.666 500.46(static  const  Font*  lookup\(const  char*\);) 8 214.067 ws
45.666 488.94(static  const  Font*  lookup\(const  String&\);) 8 223.517 ws
45.666 472.42(const  char*  name\(\)  const;) 6 159.597 ws
45.666 460.9(const  char*  encoding\(\)  const;) 6 175.167 ws
45.666 449.38(Coord  size\(\);) 2 102.896 ws
45.666 426.34(void  font_bbox\(FontBoundingBox&\)  const;) 4 232.986 ws
45.666 414.82(void  char_bbox\(FontCharCode,  FontBoundingBox&\)  const;) 6 306.896 ws
45.666 403.3(void  stringt_bbox\(const  char*,  int,  FontBoundingBox&\);) 8 288.556 ws
45.666 391.78(virtual  Coord  width\(FontCharCode\);) 4 203.486 ws
45.666 380.26(virtual  Coord  width\(const  char*,  int\);) 8 204.047 ws
45.666 368.74(virtual  int  index\(const  char*,  int,  float  offset,  boolean  between\);) 16 321.357 ws
37.336 357.22(};) 2 43.456 as
37.336 334.18(interface  PSFont  :  Font  {) 8 146.287 ws
45.666 322.66(PSFont\() 7 82.346 as
53.996 311.14(const  char*  psname,  Coord  size,  const  char*  encoding,  float  scale) 18 345.237 ws
45.666 299.62(\);) 2 51.776 as
37.336 288.1(};  ) 2 46.2364 ws
10 /Helvetica sf
115.626 271.58(Figure  6.3:) 2 163.426 ws
171.756 271.58(Font  and  PSFont  class  interfaces) 8 319.046 ws
newpath
16 263.41 moveto
16 264.41 lineto
412 264.41 lineto
412 263.41 lineto
closepath
gsave eofill grestore
showpage
%%Page: 5 5
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
26.668 671.36(Transformer::premultiply  and  Transformer::postmultiply   set  the  matrix  to  be) 15 412 ws
16 657.62(the  result  of  multiplying  the  matrix  and  the  given  matrix.   Two  operations  are) 25 412 ws
16 643.88(necessary  because  matrix  multiplication  is  not  commutative  for  2D  coordinates.) 18 412 ws
16 630.14(Premultiply  means  the  current  matrix  is  on  the  left-hand  side  of  the  multiplication,) 24 412 ws
16 616.4(postmultiply  means  the  current  matrix  is  on  the  right.   Transformer::invert  sets  the) 23 412 ws
16 602.66(matrix  to  its  inverse.) 6 114.665 ws
26.668 588.02(Transformer::translate  modifies  the  matrix  to  add  ) 12 270.766 ws
10 /Helvetica sf
270.766 588.02(dx) 2 281.326 as
12 /Times-Roman sf
281.326 588.02(  to  the  x  coordinate  and  ) 12 401.44 ws
10 /Helvetica sf
401.44 588.02(dy) 2 412 as
12 /Times-Roman sf
16 574.28(to  the  y  coordinate.   Transformer::scale  modifies  the  matrix  to  multiply  the  x  and) 25 412 ws
16 560.54(y  coordinates  by  ) 6 100.481 ws
10 /Helvetica sf
100.481 560.54(sx) 2 110.481 as
12 /Times-Roman sf
110.481 560.54(  and  ) 4 135.25 ws
10 /Helvetica sf
135.25 560.54(sy) 2 145.25 as
12 /Helvetica sf
145.25 560.54(,) 1 148.586 as
12 /Times-Roman sf
148.586 560.54(  respectively.   Transformer::rotate  modifies  the  matrix) 11 412 ws
16 546.8(to  rotate  x  and  y  coordinates  by  a  given  angle  in  degrees.   Transformer::skew) 25 412 ws
16 533.06(modifies  the  matrix  to  skew  coordinates  by  ) 14 226.313 ws
10 /Helvetica sf
226.313 533.06(sx) 2 236.313 as
12 /Times-Roman sf
236.313 533.06(  and  ) 4 259.641 ws
10 /Helvetica sf
259.642 533.06(sy) 2 269.642 as
12 /Times-Roman sf
269.642 533.06(.) 1 272.642 as
26.668 518.42(Transformer::transform  multiplies  the  given  coordinates  by  the  matrix  to) 16 412 ws
16 504.68(compute  transformed  coordinates.   The  coordinates  can  either  transformed  in) 17 412 ws
16 490.94(place  stored  in  specific  out  parameters  \(tx,  ty\).   Transformer::inverse_transform) 17 412 ws
16 477.2(performs  the  inverse  mapping;  taking  transformed  coordinates  and  returning  the) 18 412 ws
16 463.46(original  coordinates.) 2 114.652 ws
26.668 448.82(The  following  example  shows  how  to  use  transformers:) 14 293.633 ws
10 /Helvetica sf
40.99 430.34(Transformer  t;) 2 103.78 ws
120.44 430.34(//  start  with  identity) 6 203.251 ws
40.99 418.82(t.rotate\(90.0\);) 15 101.02 as
40.99 406.3(t.translate\(20.0,  10.0\);) 2 138.82 ws
40.99 394.78(t.scale\(0.5,  0.5\);) 2 112.69 ws
40.99 383.26(float  x  =  1.0,  y  =  0.0;) 12 131.612 ws
40.99 371.74(float  tx,  ty;) 4 86.5707 ws
12 /Times-Roman sf
388.72 38.96(6-) 2 398.716 as
401.716 38.96(5) 1 407.716 as
389.04 39.12(6-) 2 399.036 as
402.036 39.12(5) 1 408.036 as
newpath
17.92 344.62 moveto
17.92 345.62 lineto
413.92 345.62 lineto
413.92 344.62 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
39.256 328.06(interface  Transformer  :  Resource  {) 8 192.087 ws
47.586 316.54(Transformer\(\);) 14 111.476 as
47.586 305.02(Transformer\() 12 105.366 as
55.916 293.5(float  a00,  float  a01,  float  a10,  float  a11,  float  a20,  float  a21) 22 313.877 ws
47.586 281.98(\);) 2 53.696 as
47.586 270.46(boolean  identity\(\)  const;) 4 153.747 ws
47.586 258.94(void  premultiply\(const  Transformer&\);) 4 214.286 ws
47.586 247.42(void  postmultiply\(const  Transformer&\);) 4 218.736 ws
47.586 235.9(void  invert\(\);) 2 102.596 ws
47.586 224.38(void  translate\(float  dx,  float  dy\);) 8 186.537 ws
47.586 212.86(void  scale\(float  sx,  float  sy\);) 8 170.407 ws
47.586 201.34(void  rotate\(float  angle\);) 4 149.857 ws
47.586 189.82(void  skew\(float  sx,  float  sy\);) 8 169.847 ws
47.586 178.3(void  transform\(floatx,  floaty\);) 4 173.737 ws
47.586 166.78(void  transform\(float  x,  float  y,  floattx,  floatty\);) 12 243.777 ws
47.586 155.26(void  inverse_transform\(floatx,  floaty\);) 4 211.526 ws
47.586 143.74(void  inverse_transform\(float  tx,  float  ty,  floatx,  floaty\);) 12 281.567 ws
47.586 132.22(void  matrix\(floata00,  floata01,  floata10,  floata11,  floata20,  floata21\);) 12 346.646 ws
39.256 120.7(};  ) 2 48.1564 ws
10 /Helvetica sf
144.791 104.18(Figure  6.4:) 2 192.591 ws
200.921 104.18(Transformer  protocol) 2 293.721 ws
newpath
17.92 96.01 moveto
17.92 97.01 lineto
413.92 97.01 lineto
413.92 96.01 lineto
closepath
gsave eofill grestore
showpage
%%Page: 6 6
90.05 36.94 translate
0 0 0 setrgbcolor
10 /Helvetica sf
40.99 672.32(t.transform\(x,  y,  tx,  ty\);) 6 140.461 ws
40.99 659.84(//  now  tx  =  10.0,  ty  =  5.5) 14 147.732 ws
12 /Times-Roman sf
16 645.2(Although  the  transformation  is  a  single  step,  one  can  think  of  it  as  individual  steps) 28 412 ws
16 631.46(for  each  of  the  rotate,  translate,  and  scale  steps.   First  the  given  point  \(1.0,0.0\)  is) 29 412 ws
16 617.72(rotated  to  \(0.0,1.0\),  then  it  is  translated  to  \(20.0,11.0\),  finally  it  is  scaled  to) 26 412 ws
16 603.98(\(10.0,5.5\).  ) 2 68.9924 ws
14 /Times-Bold sf
16 577.58(6.1.5) 5 44 as
56 577.58(Bitmap) 6 100.338 as
12 /Times-Roman sf
16 557.14(A  bitmap  is  a  two-dimensional  array  of  boolean  values.   A  bitmap  is  useful  for) 27 412 ws
16 543.4(stenciling;  that  is,  drawing  through  a  mask  that  allows  some  pixels  to  be  drawn) 26 412 ws
16 529.66(but  prevents  others  from  being  changed.   The  Stencil  class  can  be  used  to  put  a) 29 412 ws
16 515.92(bitmap  in  a  glyph  graph.) 8 133.661 ws
26.668 501.28(Figure  6.5  shows  the  Bitmap  class  interface.   There  are  two  constructors) 21 412 ws
16 487.54(for  bitmaps.   One  takes  the  bitmap  data,  width,  height,  and  origin.   The  other) 26 412 ws
16 473.8(constructor  creates  a  bitmap  for  a  given  character  in  a  font,  optionally  scaling  by  a) 28 412 ws
16 460.06(given  factor.   In  this  case,  the  bitmap  width  and  height  will  reflect  the  actual  size) 29 412 ws
16 446.32(of  the  character  glyph  and  the  bitmap  origin  will  be  the  same  as  the  character) 28 412 ws
16 432.58(origin.) 7 47.668 as
26.668 417.94(Bitmap::open  operation  tries  to  open  a  file  containing  a  bitmap  definition  in  the) 24 412 ws
16 404.2(format  produced  by  the  X  bitmap  program.   If  the  file  is  found  and  is  a  valid) 31 412 ws
16 390.46(format,  open  returns  true  and  sets  the  bitmap  information.) 16 293.297 ws
26.668 375.82(Bitmap::peek  and  Bitmap::poke  are  used  to  read  and  write  at  specified  positions) 22 412 ws
16 362.08(in  the  bitmap.   Bitmap::width  and  Bitmap::height  return  the  width  and  height  of) 23 412 ws
16 348.34(the  bitmap  in  coordinates,  while  Bitmap::pwidth  and  Bitmap::pheight  return  the) 18 412 ws
16 334.6(number  of  bits  defined  in  each  dimension.) 12 218.309 ws
26.668 319.96(Treating  the  bitmap  origin  as  \(0,0\),  Bitmap::left_bearing,  Bitmap::right_bearing,) 14 412 ws
16 306.22(Bitmap::ascent,  and  Bitmap::descent  return  the  left,  right,  top,  and  bottom) 18 412 ws
16 292.48(coordinates  of  the  bitmap,  respectively.   For  example,  a  16x16  bitmap  with  its) 23 412 ws
16 278.74(origin  at  \(7,5\)  would  have  a  left_bearing  of  -7,  a  right_bearing  of  9,  an  ascent  of) 30 412 ws
16 265(12,  and  a  descent  of  -5.  ) 12 130.638 ws
388.72 38.96(6-) 2 398.716 as
401.716 38.96(6) 1 407.716 as
389.04 39.12(6-) 2 399.036 as
402.036 39.12(6) 1 408.036 as
newpath
15.0401 248.62 moveto
15.0401 249.62 lineto
411.04 249.62 lineto
411.04 248.62 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
36.3761 232.06(interface  Bitmap  :  Resource  {) 8 165.877 ws
44.7061 220.54(Bitmap\() 7 79.1561 as
53.0361 209.02(void*,  unsigned  int  width,  unsigned  int  height,  int  x0  =  -1,  int  y0  =  -1) 28 349.867 ws
44.7061 197.5(\);) 2 50.8161 as
44.7061 185.98(Bitmap\(Font*,  int  code,  float  scale  =  1.0\);) 12 225.627 ws
44.7061 174.46(static  Bitmap*  open\(const  char*  filename\);) 8 230.887 ws
44.7061 162.94(void  poke\(boolean  set,  unsigned  int  x,  unsigned  int  y\);) 16 283.167 ws
44.7061 151.42(void  peek\(unsigned  int  x,  unsigned  int  y\);) 12 225.907 ws
44.7061 139.9(Coord  width\(\)  const,  height\(\)  const;) 8 200.317 ws
44.7061 128.38(unsigned  int  pwidth\(\)  const,  pheight\(\)  const;) 10 238.127 ws
44.7061 116.86(Coord  left_bearing\(\)  const,  right_bearing\(\)  const;) 8 260.347 ws
44.7061 105.34(Coord  ascent\(\)  const,  descent\(\)  const;) 8 214.217 ws
36.3761 93.82(};) 2 42.4961 as
10 /Helvetica sf
153.576 77.3(Figure  6.5:) 2 201.376 ws
209.706 77.3(Bitmap  protocol) 2 279.176 ws
newpath
15.0401 69.13 moveto
15.0401 70.13 lineto
411.04 70.13 lineto
411.04 69.13 lineto
closepath
gsave eofill grestore
showpage
%%Page: 7 7
90.05 36.94 translate
0 0 0 setrgbcolor
14 /Times-Bold sf
16 670.4(6.1.6) 5 44 as
56 670.4(Raster) 6 95.648 as
12 /Times-Roman sf
16 649.96(A  raster  is  a  color  image  specified  by  a  two-dimensional  array  of  colors.   The) 27 412 ws
16 636.22(Image  class  can  be  used  to  put  a  raster  in  a  glyph  graph.   The  TIFFRaster  class) 31 412 ws
16 622.48(provides  a  single  operation,  load,  for  reading  a  TIFF  image  file  and  creating  a) 26 412 ws
16 608.74(raster  for  it.   If  the  file  is  not  readable  or  not  a  valid  TIFF  file,  TIFFRaster::load) 31 412 ws
16 595(will  return  nil.) 4 85.0008 ws
26.668 580.36(Figure  6.6  shows  the  Raster  and  TIFFRaster  class  interfaces.  The  raster) 20 412 ws
16 566.62(constructor  is  given  the  size  of  the  array  of  colors.   Raster::width  and) 23 412 ws
16 552.88(Raster::height  return  the  dimensions  of  the  raster  in  coordinates,  while) 18 412 ws
16 539.14(Raster::pwidth  and  Raster::pheight  return  the  dimensions  of  the  array.   A  raster's) 21 412 ws
16 525.4(origin  is  always  the  lower  left  corner.) 12 195.63 ws
26.668 510.76(Raster::peek  and  Raster::poke  read  and  write  the  color  array,  accessing  colors) 20 412 ws
16 497.02(in  terms  of  the  RGB  intensities  and  an  alpha  value.   Peek  and  poke  operations  are) 29 412 ws
16 483.28(guaranteed  to  be  cheap;  that   is,  any  processing  \(especially  interaction  with  the) 23 412 ws
16 469.54(window  system\)  will  be  deferred  until  the  raster  is   next  displayed.) 21 334.457 ws
18 /Times-Bold sf
16 428.26(6.2) 3 38.5 as
51 428.26(Canvas) 6 108.006 as
12 /Times-Roman sf
16 395.86(A  canvas  is  a  2-dimensional  area  on  which  to  draw.   The  base  implementation) 25 412 ws
16 382.12(draws  on  a  portion  of  the  screen,  normally  created  by  a  window  object  rather) 26 412 ws
16 368.38(than  directly  by  an  application.   The  Printer  subclass  uses  the  same  rendering) 23 412 ws
16 354.64(operations  to  generate  PostScript  to  a  file.   Thus,  it  is  possible  to  write  a  single) 29 412 ws
16 340.9(drawing  routine  that  can  be  used  to  generate   screen   or  printer  output.) 24 349.589 ws
26.668 326.26(Figure  6.7  shows  the  canvas  and  printer  operations.   For  screen  canvases,) 21 412 ws
16 312.52(Canvas::window  returns  the  window  containing  the  canvas;  otherwise  it  returns) 18 412 ws
388.72 38.96(6-) 2 398.716 as
401.716 38.96(7) 1 407.716 as
389.04 39.12(6-) 2 399.036 as
402.036 39.12(7) 1 408.036 as
newpath
15.04 287.02 moveto
15.04 288.02 lineto
411.04 288.02 lineto
411.04 287.02 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
36.376 270.46(interface  Raster  :  Resource  {) 8 164.207 ws
44.706 258.94(Raster\(unsigned  int  pwidth,  unsigned  int  pheight\);) 10 264.257 ws
44.706 247.42(Coord  width\(\)  const,  height\(\)  const;) 8 200.317 ws
44.706 235.9(unsigned  int  pwidth\(\)  const,  pheight\(\)  const;) 10 238.127 ws
44.706 224.38(void  peek\() 2 90.8363 ws
53.036 212.86(unsigned  int  x,  unsigned  int  y,) 10 184.777 ws
53.036 201.34(ColorIntensity&  r,  ColorIntensity&  g,  ColorIntensity&  b,  float&  alpha) 14 348.716 ws
44.706 189.82(\)  const;) 2 77.4963 ws
44.706 178.3(void  poke\() 2 90.8363 ws
53.036 166.78(unsigned  int  x,  unsigned  int  y,) 10 184.777 ws
53.036 155.26(ColorIntensity  r,  ColorIntensity  g,  ColorIntensity  b,  float  alpha) 14 322.037 ws
44.706 143.74(\);) 2 50.816 as
36.376 132.22(};) 2 42.496 as
36.376 115.7(interface  TIFFRaster  {) 4 134.187 ws
44.706 104.18(static  Raster*  load\(const  char*  filename\);) 8 225.877 ws
36.376 92.66(};  ) 2 45.2764 ws
10 /Helvetica sf
115.511 76.14(Figure  6.6:) 2 163.311 ws
171.641 76.14(Raster  and  TIFFRaster  protocols) 6 317.241 ws
newpath
15.04 67.97 moveto
15.04 68.97 lineto
411.04 68.97 lineto
411.04 67.97 lineto
closepath
gsave eofill grestore
showpage
%%Page: 8 8
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 671.36(nil.   Canvas::width  and  Canvas::height  return  the  dimensions  of  the  canvas  in) 21 412 ws
16 657.62(coordinates.) 12 74.32 as
26.668 642.98(The  canvas  rendering  operations  are  similar  to  the  PostScript) 16 412 ws
16 629.24(drawing  operations.   Canvas::new_path,  Canvas::move_to,  Canvas::line_to,) 9 412 ws
16 615.5(Canvas::curve_to,  and  Canvas::close_path  are  used  to  define  a  list  of  coordinates) 20 412 ws
16 601.76(on  which  to  perform  a  drawing  operation.   Canvas::move_to  sets  the  position  in) 23 412 ws
16 588.02(the  path,  and  Canvas::line_to  extends  the  path  to  a  new  position.   Canvas::curve_to) 23 412 ws
16 574.28(also  extends  the  path,  but  with  a  Bezier  curve  between  the  old  and  new  positions.) 28 412 ws
16 560.54(Canvas::close_path  closes  the  path.   Canvas::stroke  draws  along  the  current  path) 19 412 ws
16 546.8(with  a  given  brush  and  color.   Canvas::fill  draws  inside  the  path  with  a  given) 27 412 ws
16 533.06(color.   Canvas::clip  restricts  subsequent  drawing  to  be  inside  the  path.   Clipping  is) 24 412 ws
16 519.32(cumulative;  that  is,  two  consecutive  clip  operations  will  result  in  a  clipping  region) 24 412 ws
16 505.58(that  is  the  intersection  of  the  paths  specified  by  the  two  requests.) 22 325.961 ws
26.668 490.94(Canvas::line,  Canvas::rect,  Canvas::fill_rect,  and  Canvas::clip_rect  are  provided) 12 412 ws
16 477.2(for  convenience.   Canvas::line  is  equivalent  to  stroking  a  path  with  two  points,) 23 412 ws
16 463.46(Canvas::rect  strokes  a  rectangular  path,  Canvas::fill_rect  fills  a  rectangular  path,) 18 412 ws
16 449.72(and  Canvas::clip_rect  restricts  subsequent  output  to  be  within  a  rectangular  path.) 20 403.612 ws
26.668 435.08(Drawing  operations  are  typically  batched  to  improve  performance.   For) 17 412 ws
16 421.34(example,  a  series  of  Canvas::character  operations  might  be  combined  into  a  single) 22 412 ws
16 407.6(request  on  many  graphics  systems.   An  application  cannot  determine  if  or  when  a) 25 412 ws
16 393.86(particular  operation  has  completed.   No  synchronization  operations  are  defined  on) 19 412 ws
16 380.12(a  canvas,  as  several  canvases  may  be  active  at  the  same  time.   Display::flush  or) 27 412 ws
16 366.38(Display::sync  can  be  used  to  wait  until  the  display  starts  or  finishes  drawing,) 24 412 ws
16 352.64(respectively.) 13 76.984 as
26.668 338(As  an  example  of  the  drawing  operations,  the  following  code  draws  a  filled) 24 412 ws
16 324.26(triangle  with  corners  \(x1,y1\),  \(x2,y2\),  and  \(x3,y3\):) 12 258.953 ws
10 /Helvetica sf
40.99 305.78(canvas->new_path\(\);) 19 134.64 as
40.99 294.26(canvas->move_to\(x1,  y1\);) 2 156.31 ws
40.99 282.74(canvas->line_to\(x2,  y2\);) 2 147.42 ws
40.99 271.22(canvas->line_to\(x3,  y3\);) 2 147.42 ws
40.99 259.7(canvas->close_path\(\);) 21 139.64 as
40.99 247.22(canvas->fill\(color\);  ) 2 125.17 ws
18 /Times-Bold sf
16 205.94(6.3) 3 38.5 as
51 205.94(Printer) 7 106.98 as
12 /Times-Roman sf
16 173.54(A  printer  is  a  2-D  drawing  surface  like  a  canvas,  but  that  generates  output  for) 28 412 ws
16 159.8(hardcopy  or  previewing.   The  printer  class  normally  generates  PostScript  text  to  a) 23 412 ws
16 146.06(file;  other  printer  formats  may  be  available  at  a  particular  site.) 20 313.601 ws
26.668 131.42(Printer  is  a  subclass  of  Canvas  with  different  implementations  for  the  drawing) 22 412 ws
16 117.68(operations.   Thus,  a  printer  can  be  passed  to  an  operation  expecting  a  canvas.   The) 28 412 ws
16 103.94(printer  class  also  provides  a  few  additional  operations.) 14 277.289 ws
26.668 89.3001(The  printer  constructor  takes  a  pointer  to  an  output  stream  where  the  print) 24 412 ws
16 75.5601(representation  will  be  written.   Printer::resize  specifies  the  boundaries  of  the) 19 412 ws
16 61.8201(printed  page.   Printer::comment  generates  text  that  will  appear  in  the  output) 21 412 ws
388.72 38.96(6-) 2 398.716 as
401.716 38.96(8) 1 407.716 as
389.04 39.12(6-) 2 399.036 as
402.036 39.12(8) 1 408.036 as
showpage
%%Page: 9 9
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 151.89(stream,  but  will  not  show  on  the  printed  page.   Printer::page  generates  information) 23 412 ws
16 138.15(about  the  current  page.   This  operation  will  not  result  in  any  printed  output,  but  is) 29 412 ws
16 124.41(used  by  previewers.   Printer::flush  forces  any  locally-buffered  data  to  be  written.   ) 24 406.576 ws
388.72 38.96(6-) 2 398.716 as
401.716 38.96(9) 1 407.716 as
389.04 39.12(6-) 2 399.036 as
402.036 39.12(9) 1 408.036 as
newpath
16.72 677.26 moveto
16.72 678.26 lineto
412.72 678.26 lineto
412.72 677.26 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.056 660.7(interface  Canvas  {) 4 119.207 ws
46.386 649.18(Window*  window\(\)  const;) 4 158.077 ws
46.386 637.66(Coord  width\(\)  const,  height\(\)  const;) 8 201.997 ws
46.386 621.14(PixelCoord  to_pixels\(Coord\)  const;) 4 200.876 ws
46.386 609.62(Coord  to_coord\(PixelCoord\)  const;) 4 200.326 ws
46.386 598.1(Coord  to_pixels_coord\(Coord\)  const;) 4 209.776 ws
46.386 581.58(void  new_path\(\);) 2 120.306 ws
46.386 570.06(void  move_to\(Coord  x,  Coord  y\);) 8 190.877 ws
46.386 558.54(void  line_to\(Coord  x,  Coord  y\);) 8 181.987 ws
46.386 547.02(void  curve_to\(Coord  x,  Coord  y,  Coord  x1,  Coord  y1,  Coord  x2,  Coord  y2\);) 24 375.396 ws
46.386 535.5(void  close_path\(\);) 2 125.306 ws
46.386 523.98(void  stroke\(const  Color*,  const  Brush*\);) 8 220.887 ws
46.386 512.46(void  rect\(Coord  l,  Coord  b,  Coord  r,  Coord  t,  const  Color*,  const  Brush*\);) 24 366.496 ws
46.386 500.94(void  fill\(const  Color*\);) 4 140.847 ws
46.386 489.42(void  fill_rect\(Coord  l,  Coord  b,  Coord  r,  Coord  t,  const  Color*\);) 20 319.247 ws
46.386 477.9(void  character\() 2 112.516 ws
54.716 466.38(const  Font*,  int  ch,  Coord  width,  const  Color*,  Coord  x,  Coord  y) 22 334.827 ws
46.386 454.86(\);) 2 52.496 as
46.386 443.34(void  stencil\(const  Bitmap*,  const  Color*,  Coord  x,  Coord  y\);) 16 308.137 ws
46.386 431.82(void  image\(const  Raster*,  Coord  x,  Coord  y\);) 12 245.337 ws
46.386 415.3(void  push_transform\(\),  pop_transform\(\);) 4 223.106 ws
46.386 403.78(void  transform\(const  Transformer&\);) 4 206.976 ws
46.386 392.26(void  transformer\(const  Transformer&\);) 4 215.866 ws
46.386 380.74(const  Transformer&  transformer\(\)  const;) 6 224.207 ws
46.386 369.22(void  push_clipping\(\),  pop_clipping\(\);) 4 206.446 ws
46.386 357.7(void  clip\(\);) 2 91.9464 ws
46.386 346.18(void  clip_rect\(Coord  l,  Coord  b,  Coord  r,  Coord  t\);) 16 264.787 ws
46.386 329.66(void  damage\(const  Extension&\);) 4 190.336 ws
46.386 318.14(void  damage\(Coord  l,  Coord  b,  Coord  r,  Coord  t\);) 16 263.687 ws
46.386 306.62(boolean  damaged\(const  Extension&\)  const;) 6 239.817 ws
46.386 295.1(boolean  damaged\(Coord  l,  Coord  b,  Coord  r,  Coord  t\)  const;) 18 313.167 ws
38.056 283.58(};) 2 44.176 as
38.056 267.06(interface  Printer  :  Canvas  {) 8 156.997 ws
46.386 255.54(Printer\(ostream*\);) 18 125.286 as
46.386 244.02(void  resize\(Coord  left,  Coord   bottom,  Coord  right,  Coord  top\);) 17 318.987 ws
46.386 232.5(void  comment\(const  char*\);) 4 168.087 ws
46.386 220.98(void  page\(const  char*\);) 4 149.207 ws
46.386 209.46(void  flush\(\);) 2 98.0664 ws
38.056 197.94(};  ) 2 46.9564 ws
10 /Helvetica sf
126.076 181.42(Figure  6.7:) 2 173.876 ws
182.206 181.42(Canvas  and  printer  protocols) 6 310.036 ws
newpath
16.72 173.25 moveto
16.72 174.25 lineto
412.72 174.25 lineto
412.72 173.25 lineto
closepath
gsave eofill grestore
showpage
%%Trailer
end restore
%%Pages: 9
%!PS-Adobe-2.0
%%Creator: ./ch8.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
16 662.72(Chapter  8) 2 119.321 ws
16 625.76(Styles) 6 76 as
12 /Times-Roman sf
16 597.44(User  interface  toolkits  traditionally  have  coupled  the  management  of  style) 18 412 ws
16 583.7(attributes  such  as  color  and  font  with  the  composition  of  objects  in  a  window.) 26 412 ws
16 569.96(This  coupling  is  too  rigid  and  inefficient  for  many  applications  because   attributes) 23 412 ws
16 556.22(are  ) 2 36.6217 ws
12 /Times-Italic sf
36.6217 556.22(logical) 7 69.9577 as
12 /Times-Roman sf
69.9577 556.22(  information,  whereas  composition  is  a  ) 12 277.424 ws
12 /Times-Italic sf
277.424 556.22(physical) 8 317.42 as
12 /Times-Roman sf
317.42 556.22(  organization.   For) 5 412 ws
16 542.48(example,  a  document  logically  contains  text  and  graphics  organized  into  chapters,) 20 412 ws
16 528.74(sections,  subsections,  and  paragraphs.   Physically,  the  document  contains  lines,) 17 412 ws
16 515(columns,  and  pages.   The  font  of  a  string  of  characters  in  the  document  is) 27 412 ws
16 501.26(independent  of  whether  there  is  a  line  break  within  the  string  or  not,  thus  the  style) 30 412 ws
16 487.52(information  is  orthogonal  to  the  layout.) 10 204.665 ws
26.668 472.88(InterViews  provides  a  ) 6 142.761 ws
12 /Times-Italic sf
142.761 472.88(style) 5 164.757 as
12 /Times-Roman sf
164.757 472.88(  class  for  organizing  user  interface  attributes.   A) 15 412 ws
16 459.14(style  is  similar  to  an  environment  in  a  text  formatting  system  such  as  Scribe.) 26 412 ws
16 445.4(Styles  may  be  nested  hierarchically,  and  attributes  defined  in  an  outer  style  are) 24 412 ws
16 431.66(visible  in  an  inner  style  if  not  otherwise  defined.   A  style  consists  of  an  optional) 29 412 ws
16 417.92(name,  an  optional  list  of  prefixes  for  wildcard-matching,  a  collection  of  attributes) 22 412 ws
16 404.18(\(name-value  pairs\),  a  collection  of  styles  nested  inside  the  style,  and  a  parent  style.) 26 412 ws
18 /Times-Bold sf
16 362.9(8.1) 3 38.5 as
51 362.9(Defining  a  style) 4 169.999 ws
12 /Times-Roman sf
16 330.5(Figure  8.1  shows  the  style  class  operations  for  creating  and  accessing  simple) 22 412 ws
16 316.76(style  information.   When  a  style  is  created,  its  name  and  parent  style  may  be) 27 412 ws
16 303.02(specified.   The  default  parent  style  is  nil.   Style::name  sets  or  gets  the  style's) 26 412 ws
16 289.28(name.   Style::parent  gets  the  style's  parent.   The  parent  cannot  be  set  directly,  but) 26 412 ws
16 275.54(can  be  changed  by  appending  the  style  to  its  \(new\)  parent.) 20 294.941 ws
26.668 260.9(Style::append  and  Style::remove  add  and  delete  a  style  from  the  list  of  styles) 24 412 ws
16 247.16(nested  inside  another  style.   Style::children  returns  the  number  of  nested  styles.) 21 412 ws
16 233.42(Style::child  returns  the  indexed  child  in  the  list.   Style::find_style  returns  the) 21 412 ws
16 219.68(nested  style  with  the  given  name  or  nil  if  there  is  none.) 22 279.306 ws
26.668 205.04(Style::attribute  adds  a  <) 6 142.876 ws
12 /Times-Italic sf
142.876 205.04(name,value) 10 197.86 as
12 /Times-Roman sf
197.86 205.04(>  pair  to  the  list  of  attributes  in  the  style.   If) 21 412 ws
16 191.3(an  attribute  is  already  defined  with  the  name,  the  value  will  be  updated  unless) 26 412 ws
16 177.56(the  specified  priority  is  lower  than  the  already-defined  priority  of  the  attribute) 22 412 ws
16 163.82(Style::remove_attribute  deletes  the  named  attribute  from  the  style's  attribute  list.) 18 412 ws
16 150.08(Style::attributes  and  the  get  form  of  Style::attribute  can  be  used  to  retrieve  all  the) 26 412 ws
16 136.34(attributes   defined  on  a  style.   The  order  of  the  list  is  arbitrary.) 24 311.285 ws
18 /Times-Bold sf
16 95.0601(8.2) 3 38.5 as
51 95.0601(Finding  an  attribute) 4 207.025 ws
12 /Times-Roman sf
16 62.6601(The  style  class  provides  two  overloaded  functions  for  finding  an  attribute  value) 22 412 ws
394.8 38.16(8-) 2 404.796 as
407.796 38.16(1) 1 413.796 as
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 262.05(given  the  name.   Style::find_attribute  takes  two  parameters  and  returns  a  boolean) 21 412 ws
16 248.31(value  that  is  true  if  the  attribute  is  found  and  false  otherwise.   The  first  parameter) 29 412 ws
16 234.57(is  the  desired  name,  which  can  either  be  passed  as  a  String  object  or  a  ) 30 386.668 ws
12 /Times-Italic sf
386.668 234.57(const) 5 412 as
16 220.83(char*) 5 43.996 as
12 /Times-Roman sf
43.996 220.83(.   The  second  parameter  is  a  reference  to  where  the  value  of  the  attribute) 27 412 ws
16 207.09(should  be  stored  if  found.   If  the  parameter  is  a  string,  then  the  value  is  simply) 31 412 ws
16 193.35(copied  directly.   If  it  is  a  long  or  double,  then  value  string  is  converted  to  a) 31 412 ws
16 179.61(number.   If  the  result  parameter  is  a  Coord,  then  the  value  string  is  converted  to  a) 31 412 ws
16 165.87(number  and  multiplied  by  the  units  specified  in  the  value  string  after  the  number.) 26 412 ws
16 152.13(The  unit  specification  can  be  \252in\272  for  inches,  \252cm\272  for  centimeters,  \252mm\272  for) 24 412 ws
16 138.39(millimeters,  \252em\272  for  the  width  in  points  of  the  character  \252m\272  in  the  style's  font,) 28 412 ws
16 124.65(and  \252pt\272  for  points.) 6 108.653 ws
26.668 110.01(The  other  function  for  finding  an  attribute  is  Style::value_is_on.   This  function) 21 412 ws
16 96.27(is  equivalent  to  calling  Style::find_attribute  and  testing  if  the  value  string  is  \252on\272) 24 412 ws
16 82.53(or  \252true\272.   The  test  is  case-insensitive.) 11 197.129 ws
394.8 38.16(8-) 2 404.796 as
407.796 38.16(2) 1 413.796 as
newpath
16.24 672.22 moveto
16.24 673.22 lineto
412.24 673.22 lineto
412.24 672.22 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.576 655.66(interface  Style  :  Resource  {) 8 158.187 ws
45.906 644.14(Style\(\);) 8 77.576 as
45.906 632.62(Style\(const  String&  name\);) 4 164.836 ws
45.906 621.1(Style\(Style*  parent\);) 2 134.826 ws
45.906 609.58(Style\(const  String&  name,  Style*  parent\);) 8 227.647 ws
45.906 593.06(void  name\(const  String&\);) 4 160.947 ws
45.906 581.54(const  String*  name\(\)  const;) 6 166.507 ws
45.906 570.02(void  alias\(const  String&\);) 4 156.497 ws
45.906 558.5(long  alias_count\(\)  const;) 4 154.287 ws
45.906 546.98(const  String*  alias\(long\)  const;) 6 180.957 ws
45.906 535.46(Style*  parent\(\)  const;) 4 139.277 ws
45.906 518.94(void  append\(Style*\);) 2 135.946 ws
45.906 507.42(void  remove\(Style*\);) 2 135.926 ws
45.906 495.9(long  children\(\)  const;) 4 138.717 ws
45.906 484.38(Style*  child\(long\)  const;) 4 150.387 ws
45.906 467.86(void  attribute\(const  String&  name,  const  String&  value,  int  priority  =  0\);) 20 357.426 ws
45.906 456.34(void  remove_attribute\(const  String&  name\);) 6 238.757 ws
45.906 444.82(long  attributes\(\)  const;) 4 144.837 ws
45.906 433.3(boolean  attribute\(long,  String&  name,  String&  value\)  const;) 12 306.587 ws
45.906 416.78(void  add_trigger\(const  String&  ,  Action*\);) 8 226.537 ws
45.906 405.26(void  remove_trigger\(const  String&,  Action*  =  nil\);) 10 261.817 ws
45.906 393.74(void  add_trigger_any\(Action*\);) 2 180.406 ws
45.906 382.22(void  remove_trigger_any\(Action*\);) 2 197.066 ws
45.906 365.7(boolean  find_attribute\(const  String&,  String&  value\)  const;) 10 302.696 ws
45.906 354.18(boolean  find_attribute\(const  String&,  long&\)  const;) 8 268.797 ws
45.906 342.66(boolean  find_attribute\(const  String&,  double&\)  const;) 8 279.916 ws
45.906 331.14(boolean  find_attribute\(const  String&,  Coord&\)  const;) 8 277.126 ws
45.906 319.62(boolean  value_is_on\(const  String&\);) 4 206.536 ws
37.576 308.1(};) 2 43.696 as
10 /Helvetica sf
157.831 291.58(Figure  8.1:) 2 205.631 ws
213.961 291.58(Style  protocol.) 2 277.321 ws
newpath
16.24 283.41 moveto
16.24 284.41 lineto
412.24 284.41 lineto
412.24 283.41 lineto
closepath
gsave eofill grestore
showpage
%%Page: 3 3
90.05 36.94 translate
0 0 0 setrgbcolor
18 /Times-Bold sf
16 667.52(8.3) 3 38.5 as
51 667.52(Wildcard  matching) 2 200.508 ws
12 /Times-Roman sf
16 635.12(Attribute  names  may  contain  \252*\272  characters  to  specify  wildcard  matching.   A) 21 412 ws
16 621.38(name  of  the  form  A*B  will  match  an  attribute  B  in  a  nested  style  named  A.) 30 412 ws
16 607.64(Wildcard  names  also  may  begin  with  a  \252*\272,  which  matches  in  any  descendant) 24 412 ws
16 593.9(style.   Thus,  *A*B  will  match  an  attribute  B  in  any  descendant  style  named  A.) 27 412 ws
16 580.16(Because  attributes  are  inherited,  specifying  the  wildcard  name  *B  is   identical  to) 23 412 ws
16 566.42(specifying  the  normal  attribute  B.) 8 177.653 ws
26.668 551.78(In  addition  to  a  name,  styles  may  have  a  list  of  associated  aliases.   Style::alias) 27 412 ws
16 538.04(prepends  a  string  to  the  list.   Wildcard  matches  search  using  a  style's  name  first,) 27 412 ws
16 524.3(then  search  using  the  style's  aliases  in  the  reverse  order  in  which  they  are  defined.) 28 412 ws
16 510.56(Aliases  are  typically  used  for  indicating  a  subclass  relationship  and  allowing) 20 412 ws
16 496.82(styles  to  inherit  attributes  specified  for  a  superclass.) 14 264.629 ws
26.668 482.18(For  example,  suppose  the  root  style  defines  the  following  attributes:) 18 353.309 ws
10 /Helvetica sf
48.004 467.54(*Mover*autorepeat:off) 21 145.274 as
48.004 453.1(*UpMover*autorepeat:on) 22 158.054 as
12 /Times-Roman sf
26.668 433.66(Consider  descendant  styles  S  and  T:   S's  aliases  are  UpMover  and  Mover;  T's) 25 412 ws
16 419.92(aliases  are  DownMover  and  Mover.   Style::find_attribute  for  \252autorepeat\272  will) 17 412 ws
16 406.18(return  \252on\272  for  S,  \252off\272  for  T.) 12 157.95 ws
26.668 391.54(The  wildcard  matching  algorithm  is  compatible  with  the  X  resource  manager  to) 22 412 ws
16 377.8(support  the  same  user  customization  functionality.   Wildcard  attributes  typically) 17 412 ws
16 364.06(are  defined  only  on  the  root  style,  as  loaded  from  the  window  system,  application) 26 412 ws
16 350.32(defaults  files,  or  command-line  arguments.) 8 221.969 ws
18 /Times-Bold sf
16 309.04(8.4) 3 38.5 as
51 309.04(Using  styles  with  glyphs) 6 234.529 ws
12 /Times-Roman sf
16 276.64(Glyphs  that  draw  typically  contain  the  specific  style  information  they  need  to) 22 412 ws
16 262.9(render.   For  example,  a  character  glyph  contains  the  font  and  color  it  uses  to  draw.) 29 412 ws
16 249.16(Higher  level  glyphs,  such  as  a  slider  for  scrolling,  contain  a  style  from  which) 26 412 ws
16 235.42(they  construct  their  components.   When  styles  support  trigger  routines  to  detect) 21 412 ws
16 221.68(attribute  value  changes,  these  higher-level  components  will  be  able  to  reconstruct) 20 412 ws
16 207.94(their  contents  automatically.) 4 152.321 ws
26.668 193.3(Figure  8.2  shows  a  function  that  builds  a  vertical  scrollbar  by  creating  a) 24 412 ws
16 179.56(box  containing  an  up-mover  \(button  with  up-arrow\),  a  scroller  \(slider\),  and  a) 22 412 ws
16 165.82(down-mover  \(button  with  down-arrow\).   The  function  creates  a  new  style  and) 21 412 ws
16 152.08(gives  it  the  prefixes  VScrollBar  and  ScrollBar  for  customization.   If  the  attribute) 23 412 ws
16 138.34(\252mover_size\272  is  defined  on  the  style,  then  its  value  will  override  the  default  \(15.0\).) 26 412 ws
18 /Times-Bold sf
16 97.0601(8.5) 3 38.5 as
51 97.0601(Summary) 7 126.996 as
12 /Times-Roman sf
16 64.6601(User  interface  geometry  and  attribute  management  are  two  different  problems  that) 20 412 ws
394.8 38.16(8-) 2 404.796 as
407.796 38.16(3) 1 413.796 as
showpage
%%Page: 4 4
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 671.36(are  best  solved  independently.   Whereas  glyphs  define  a  physical  organization) 19 412 ws
16 657.62(with  a  directed  acyclic  graph,  styles  define  a  logical  organization  with  a  strict) 24 412 ws
16 643.88(hierarchy.   Both  structures  are  simple  and  the  connection  between  them  is) 21 412 ws
16 630.14(straightforward.) 16 92.98 as
26.668 615.5(Styles  provide  a  unified  framework  for  managing  user-customizable  attributes,) 16 412 ws
16 601.76(document  formatting  information,  and  structured  graphics  state.   Style  prefixes) 17 412 ws
16 588.02(support  wildcarding  and  allow  the  decoupling  of  the  implementation  class) 18 412 ws
16 574.28(hierarchy  from  the  logical  class  hierarchy  offered  to  the  user  for  the  purposes) 24 412 ws
16 560.54(of  customization.   This  approach  makes  applications  simpler  to  develop,  more) 19 412 ws
16 546.8(consistent  to  use,  and  easier  to  integrate.) 12 209.969 ws
394.8 38.16(8-) 2 404.796 as
407.796 38.16(4) 1 413.796 as
showpage
%%Page: 5 5
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
394.8 38.16(8-) 2 404.796 as
407.796 38.16(5) 1 413.796 as
newpath
14.32 613.66 moveto
14.32 614.66 lineto
410.32 614.66 lineto
410.32 613.66 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
35.656 597.1(Glyph*  vscroll_bar\(Adjustable*  a\)  {) 6 188.487 ws
43.986 585.58(WidgetKit&  kit  =  *WidgetKit::instance\(\);) 6 216.547 ws
43.986 574.06(const  LayoutKit&  layout  =  *LayoutKit::instance\(\);) 8 257.707 ws
43.986 562.54(kit.begin_style\("VScrollBar"\);) 30 171.116 as
43.986 550.02(kit.alias\("ScrollBar"\);) 23 134.426 as
43.986 538.5(Style*  s  =  kit.style\(\);) 6 132.067 ws
43.986 526.98(Coord  mover_size  =  15.0;) 6 158.757 ws
43.986 515.46(s->find_attribute\("mover_size",  mover_size\);) 2 240.306 ws
43.986 503.94(Glyph*  sep  =  layout.vspace\(1.0\);) 6 188.777 ws
43.986 492.42(return  kit.inset_frame\() 2 141.236 ws
52.316 480.9(layout.vbox\() 12 106.226 as
60.646 469.38(layout.v_fixed_span\(up_mover\(a,  s\),  mover_size\),) 4 282.386 ws
60.646 457.86(sep,) 4 79.546 as
60.646 446.34(new  VScroller\(a,  s\),) 4 147.887 ws
60.646 434.82(sep,) 4 79.546 as
60.646 423.3(layout.v_fixed_span\(down_mover\(a,  s\),  mover_size\)) 4 292.386 ws
52.316 411.78(\),) 2 58.426 as
52.316 400.26(s) 1 57.316 as
43.986 388.74(\);) 2 50.096 as
35.656 377.22(}) 1 38.996 as
10 /Helvetica sf
125.901 360.7(Figure  8.2:) 2 173.701 ws
182.031 360.7(Using  styles  to  build  glyphs.) 8 305.411 ws
newpath
14.32 352.53 moveto
14.32 353.53 lineto
410.32 353.53 lineto
410.32 352.53 lineto
closepath
gsave eofill grestore
showpage
%%Trailer
end restore
%%Pages: 5
%!PS-Adobe-2.0
%%Creator: ./ch9.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
16 662.72(Chapter  9) 2 119.321 ws
16 625.76(WidgetKit) 9 124 as
12 /Times-Roman sf
16 597.44(WidgetKit  defines  operations  for  creating  user  interface  objects  with  a  concrete) 20 412 ws
16 583.7(look-and-feel.   Typically,  an  application  uses  a  widget  kit  to  create  specific) 21 412 ws
16 569.96(components,  such  as  pulldown  menus,  push  buttons,  and  scrollbars.   WidgetKit) 19 412 ws
16 556.22(isolates  the  application  from  specific  look-and-feel  issues  and  the  details  of  how) 22 412 ws
16 542.48(a  concrete  component  is  implemented.   Many  components  are  defined  using) 19 412 ws
16 528.74(instances  of  existing  classes.   For  example,  a  push  button  with  a  string  label  is) 27 412 ws
16 515(created  using  a  button,  label,  and  two  bevel  objects.) 16 264.293 ws
26.668 500.36(InterViews  provides  a  base  widget  kit  class  for  creating  common  user  interface) 22 412 ws
16 486.62(objects.   Subclasses  are  provided  for  implementing  concrete  objects  based  on  the) 21 412 ws
16 472.88(Motif  \(default\)  and  OpenLook  user  interfaces.) 10 237.941 ws
26.668 458.24(WidgetKit::instance  is  a  static  member  function  that  returns  a  default  kit.   If  a) 25 412 ws
16 444.5(kit  has  not  yet  been  created,  WidgetKit::instance  creates  one  using  the  session's) 22 412 ws
16 430.76(style  to  determine  which  kit  subclass  to  construct.) 14 255.317 ws
18 /Times-Bold sf
16 389.48(9.1) 3 38.5 as
51 389.48(Style  management) 2 192.48 ws
12 /Times-Roman sf
16 357.08(WidgetKit  maintains  a  current  style  for  use  in  customizing  widgets.   The  initial) 23 412 ws
16 343.34(style  is  the  root  style  for  all  windows.   WidgetKit  defines  the  operations  shown  in) 27 412 ws
16 329.6(Figure  9.1  for  querying  and  modifying  the  style.) 14 247.649 ws
26.668 314.96(WidgetKit::style  sets  or  gets  the  current  style.   When  the  style  is  set  or  changed) 27 412 ws
16 301.22(via  a  Style::attribute  call,  WidgetKit::style_changed  is  called  to  allow  WidgetKit) 18 412 ws
16 287.48(subclasses  to  recompute  information  associated  with  the  current  style  \(such  as) 20 412 ws
16 273.74(colors  for  shading\).) 4 109.649 ws
26.668 259.1(WidgetKit::begin_style  sets  the  current  style  to  a  newly-created  style  that  is) 20 412 ws
16 245.36(a  child  of  the  current  style.   The  given  string  is  the  name  of  the  new  style.) 31 412 ws
16 231.62(WidgetKit::alias  adds  an  alias  name  for  the  current  style.   Widget::end_style) 19 412 ws
394.8 39.12(9-) 2 404.796 as
407.796 39.12(1) 1 413.796 as
newpath
16.24 207.58 moveto
16.24 208.58 lineto
412.24 208.58 lineto
412.24 207.58 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.576 191.02(void  style\(Style*\);) 2 114.816 ws
37.576 179.5(Style*  style\(\)  const;) 4 123.157 ws
37.576 167.98(void  begin_style\(const  String&\),  end_style\(\);) 6 233.207 ws
37.576 156.46(void  alias\(const  String&\);) 4 148.167 ws
37.576 144.94(void  push_style\(\),  pop_style\(\);) 4 170.957 ws
37.576 133.42(void  style_changed\(Style*\);) 2 158.736 ws
37.576 121.9(const  Font*  font\(\)  const;) 6 143.737 ws
37.576 110.38(const  Color*  foreground\(\)  const;) 6 179.297 ws
37.576 98.86(const  Color*  background\(\)  const;) 6 183.187 ws
10 /Helvetica sf
93.9159 82.34(Figure  9.1:) 2 141.716 ws
150.046 82.34(WidgetKit  operations  for  style  management) 8 341.236 ws
newpath
16.24 74.17 moveto
16.24 75.17 lineto
412.24 75.17 lineto
412.24 74.17 lineto
closepath
gsave eofill grestore
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 524.17(returns  the  current  style  to  what  it  was  before  the  call  to  WidgetKit::begin_style.) 24 412 ws
16 510.43(WidgetKit::push_style  and  pop_style  save  and  restore  the  current  style  on  a  stack.) 22 409.276 ws
26.668 495.79(WidgetKit::font,  foreground,  and  background  return  specific  attribute) 12 412 ws
16 482.05(information  for  the  current  style.   These  operations  are  equivalent  to  \(though) 21 412 ws
16 468.31(potentially  faster  than\)  finding  the  string  value  of  a  style  attribute  and  then) 24 412 ws
16 454.57(looking  up  the  resource  with  the  given  name.   For  example,  WidgetKit::font  is) 23 412 ws
16 440.83(the  same  as  finding  the  attribute  named  \252font\272  and  calling  Font::lookup  on  the) 24 412 ws
16 427.09(attribute's  value.) 2 96.6524 ws
18 /Times-Bold sf
16 385.81(9.2) 3 38.5 as
51 385.81(Common  cursors) 2 183.48 ws
12 /Times-Roman sf
16 353.41(WidgetKit  provides  operations  to  retrieve  commonly-used  cursors  that  might  be) 18 412 ws
16 339.67(shared  among  several  widgets.   Figure  9.2  shows  the  currently-defined  operations.) 19 412 ws
16 325.93(WidgetKit::hand_cursor  is  the  outline  of  a  small  hand.   WidgetKit::lfast_cursor) 17 412 ws
16 312.19(is  a  double-arrow  pointing  to  the  left  that  is  typically  used  in  continuous  rate) 26 412 ws
16 298.45(scrolling.   Similarly,  the  other  \252fast\272  cursors  are  double-arrows  pointing  in  various) 21 412 ws
16 284.71(directions.) 11 66.328 as
18 /Times-Bold sf
16 243.43(9.3) 3 38.5 as
51 243.43(Bevels) 6 99.996 as
12 /Times-Roman sf
16 211.03(On  color  displays,  it  is  often  desirable  to  frame  objects  with  a  beveled  look  to  give) 30 412 ws
16 197.29(a  3D  appearance.   WidgetKit  provides  the  following  three  functions  for  creating) 21 412 ws
16 183.55(beveled  frames:) 2 92.3084 ws
26.668 164.11(Glyph*  inset_frame\(Glyph*\)  const;) 4 197.981 ws
26.668 150.67(Glyph*  outset_frame\(Glyph*\)  const;) 4 203.98 ws
26.668 137.23(Glyph*  bright_inset_frame\(Glyph*\)  const;) 4 232.648 ws
16 117.79(WidgetKit:inset_frame  uses  dark  shading  in  the  upper  left  and  light  shading) 20 412 ws
16 104.05(in  the  lower  right  to  make  the  contents  of  the  frame  appear  to  be  recessed.) 28 412 ws
16 90.31(WidgetKit::outset_frame  reverses  the  shading  to  make  the  contents  appear  to) 18 412 ws
16 76.57(project  out  of  the  frame.   WidgetKit::bright_inset_frame  is  like  inset_frame  but) 19 412 ws
16 62.83(uses  a  brighter  background  color  and  is  thinner.) 14 244.625 ws
394.8 39.12(9-) 2 404.796 as
407.796 39.12(2) 1 413.796 as
newpath
17.2 678.94 moveto
17.2 679.94 lineto
413.2 679.94 lineto
413.2 678.94 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.536 662.38(Cursor*  hand_cursor\(\)  const;) 4 166.906 ws
38.536 650.86(Cursor*  lfast_cursor\(\)  const;) 4 163.007 ws
38.536 639.34(Cursor*  lufast_cursor\(\)  const;) 4 168.567 ws
38.536 627.82(Cursor*  ufast_cursor\(\)  const;) 4 166.346 ws
38.536 616.3(Cursor*  rufast_cursor\(\)  const;) 4 169.676 ws
38.536 604.78(Cursor*  rfast_cursor\(\)  const;) 4 164.117 ws
38.536 593.26(Cursor*  rdfast_cursor\(\)  const;) 4 169.676 ws
38.536 581.74(Cursor*  dfast_cursor\(\)  const;) 4 166.346 ws
38.536 570.22(Cursor*  ldfast_cursor\(\)  const;) 4 168.567 ws
10 /Helvetica sf
151.296 553.7(Figure  9.2:) 2 199.096 ws
207.426 553.7(WidgetKit  cursors) 2 285.776 ws
newpath
17.2 545.53 moveto
17.2 546.53 lineto
413.2 546.53 lineto
413.2 545.53 lineto
closepath
gsave eofill grestore
showpage
%%Page: 3 3
90.05 36.94 translate
0 0 0 setrgbcolor
18 /Times-Bold sf
16 667.52(9.4) 3 38.5 as
51 667.52(Labels) 6 102.012 as
12 /Times-Roman sf
16 635.12(A  label  is  a  string  of  text  with  the  current  style's  font  and  color.   WidgetKit) 29 412 ws
16 621.38(provides  two  operations  for  creating  labels:) 10 224.297 ws
37.336 601.94(Glyph*  label\(const  char*\)  const;) 6 194.309 ws
37.336 588.5(Glyph*  label\(const  String&\)  const;) 6 206.333 ws
18 /Times-Bold sf
16 547.22(9.5) 3 38.5 as
51 547.22(Buttons) 7 111.012 as
12 /Times-Roman sf
16 514.82(A  button  is  an  input  handler  that  can  perform  an  action  when  pressed.  Buttons) 26 412 ws
16 501.08(manipulate  a  ) 4 83.8489 ws
12 /Times-Italic sf
83.8489 501.08(telltale  state) 2 144.449 ws
12 /Times-Roman sf
144.449 501.08(  object  so  that   views  \(which  are  typically  part  of  the) 21 412 ws
16 487.34(button's  body\)  can  reflect  the  current  state  visually.   The  button  itself  is  a  view  so) 29 412 ws
16 473.6(that  it  can  damage  the  canvas  when  appropriate,  freeing  other  views  from  the  need) 26 412 ws
16 459.86(to  store  update  information.) 6 149.321 ws
26.668 445.22(A  telltale  state  can  be  part  of  a  ) 16 180.277 ws
12 /Times-Italic sf
180.277 445.22(telltale  group) 2 245.821 ws
12 /Times-Roman sf
245.821 445.22(.   When  one  member  of  a  group  is) 15 412 ws
16 431.48(chosen,  then  the  currently  chosen  state  becomes  unchosen.   Telltale  groups  are) 21 412 ws
16 417.74(useful  for  implementing  radio  buttons.) 8 200.993 ws
26.668 403.1(Figure  9.3  shows  the  button,  telltale  state,  and  telltale  group  protocols.) 20 412 ws
16 389.36(Button  just  provides  operations  to  access  the  associated  telltale  state  and  action.) 22 412 ws
16 375.62(TelltaleState  defines  a  set  of  flags  that  define  the  current  state.   TelltaleState::set) 23 412 ws
16 361.88(and  TelltaleState::test  modify  and  query  the  current  state,  respectively.) 16 412 ws
16 348.14(TelltaleState::join  and  TelltaleState::leave_group  allow  the  state  to  be  associated) 16 412 ws
16 334.4(with  a  group.) 4 79.6608 ws
26.668 319.76(Figure  9.4  shows  the  WidgetKit  operations  that  return  buttons.   Push  button,) 21 412 ws
16 306.02(default  button,  and  palette  button  typically  have  a  similar  appearance.   Neither  a) 23 412 ws
16 292.28(push  button  or  a  default  button  can  be  chosen,  whereas  a  palette  button  can.   A) 29 412 ws
16 278.54(default  button  might  have  a  different  appearance  to  indicate  to  the  user  that  it  is) 28 412 ws
16 264.8(the  common  choice.) 4 112.985 ws
26.668 250.16(A  check  box  is  a  toggle  button:  choosing  it  when  already  chosen  will  cause  it  to) 30 412 ws
16 236.42(become  unchosen.   A  radio  button  must  belong  to  a  telltale  group  so  that  within) 27 412 ws
16 222.68(the  group  only  one  button  is  chosen  at  any  given  time.) 20 276.318 ws
26.668 208.04(For  application-specific  actions,  it  is  necessary  to  define  action  callbacks  for  the) 22 412 ws
16 194.3(relevant  application  classes.   In  the  case  of  quitting  the  application  WidgetKit::quit) 21 412 ws
16 180.56(can  be  used  to  return  an  action  that  calls  Session::quit.) 18 276.641 ws
18 /Times-Bold sf
16 139.28(9.6) 3 38.5 as
51 139.28(Menus) 5 103.002 as
12 /Times-Roman sf
16 106.88(A  menu  is  similar  to  a  group  of  related  buttons,  called  menu  items.   Like  a  button,) 31 412 ws
16 93.1401(the  look  of  a  menu  item  is  dependant  on  a  telltalestate.   Menu  items  can  have) 29 412 ws
16 79.4(associated  actions  that  are  executed  when  the  item  is  chosen.   Menus  items  can) 25 412 ws
16 65.66(also  have  associated  nested  menus,  in  which  case  the  submenu  is  opened  when  the) 26 412 ws
394.8 39.12(9-) 2 404.796 as
407.796 39.12(3) 1 413.796 as
showpage
%%Page: 4 4
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 260.33(item  is  highlighted.   Figure  9.5   shows  the  WidgetKit  menu  operations  and  the) 24 412 ws
16 246.59(menu  item  and  menu  protocols.) 8 167.657 ws
26.668 231.95(WidgetKit::menubar  creates  a  horizontal  menu  with  a  small  amount  of  white) 20 412 ws
16 218.21(space  between  items.   WidgetKit::pulldown  and  WidgetKit::pullright  create) 13 412 ws
16 204.47(vertical  menus.   The  top  of  a  pulldown  menu  will  be  aligned  to  the  bottom  of  the) 31 412 ws
16 190.73(menubar,  while  a  pullright's  top  will  be  aligned  to  the  top  right  of  its  containing) 28 412 ws
16 176.99(item.) 5 40.336 as
26.668 162.35(WidgetKit::menubar_item  creates  an  item  centered  horizontally  with  a  small) 16 412 ws
16 148.61(amount  of  white  space  on  each  side.   WidgetKit::menu_item  creates  a  left-adjusted) 21 412 ws
16 134.87(item,  WidgetKit::check_menu_item  creates  a  toggle  item  that  looks  like  a  check) 20 412 ws
16 121.13(box  when  chosen.   WidgetKit::radio_menu_item  creates  an  item  that  looks  like) 19 412 ws
16 107.39(a  radio  button.   WidgetKit::menu_item_separator  returns  an  item  for  visually) 17 412 ws
16 93.65(separating  other  items  \(such  as  a  horizontal  line\).) 14 251.957 ws
394.8 39.12(9-) 2 404.796 as
407.796 39.12(4) 1 413.796 as
newpath
16.24 642.46 moveto
16.24 643.46 lineto
412.24 643.46 lineto
412.24 642.46 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.576 625.9(interface  Button  :  ActiveHandler,  Observer  {) 10 230.997 ws
45.906 614.38(Button\(Glyph*,   Style*,  TelltaleState*,  Action*\);) 7 249.607 ws
45.906 602.86(TelltaleState*  state\(\)  const;) 4 165.957 ws
45.906 591.34(Action*  action\(\)  const;) 4 143.167 ws
37.576 579.82(};) 2 43.696 as
37.576 563.3(typedef  unsigned  int  TelltaleFlags;) 6 189.317 ws
37.576 546.78(interface  TelltaleState  :  Resource,  Observable  {) 10 248.227 ws
45.906 535.26(TelltaleState\(const  TelltaleFlags  =  0\);) 6 211.247 ws
45.906 523.74(enum  {) 2 77.0364 ws
54.236 512.22(is_enabled,  is_visible,  is_enabled_visible,  is_active,  is_enabled_active,) 8 368.816 ws
54.236 500.7(is_visible_active,  is_enabled_visible_active,  is_chosen,  is_enabled_chosen,) 6 390.496 ws
54.236 489.18(is_visible_chosen,  is_enabled_visible_chosen,) 2 260.436 ws
54.236 477.66(is_enabled_active_chosen,  is_active_chosen,) 2 257.116 ws
54.236 466.14(is_visible_active_chosen,  is_enabled_visible_active_chosen,) 2 323.796 ws
54.236 454.62(is_running,  is_choosable,  is_toggle,) 4 212.646 ws
54.236 443.1(max_flags) 9 99.806 as
45.906 431.58(};) 2 52.026 as
45.906 415.06(TelltaleFlags  flags\(\)  const;) 4 162.607 ws
45.906 403.54(void  set\(const  TelltaleFlags,  boolean\);) 6 214.307 ws
45.906 392.02(boolean  test\(const  TelltaleFlags\)  const;) 6 219.867 ws
45.906 380.5(void  join\(TelltaleGroup*\);) 2 155.936 ws
45.906 368.98(void  leave_group\(\);) 2 131.496 ws
37.576 357.46(};) 2 43.696 as
37.576 340.94(interface  TelltaleGroup  :  Resource  {) 8 195.977 ws
45.906 329.42(void  update\(TelltaleState*\);) 2 166.516 ws
45.906 317.9(void  remove\(TelltaleState*\);) 2 169.276 ws
37.576 306.38(};) 2 43.696 as
10 /Helvetica sf
78.9009 289.86(Figure  9.3:) 2 126.701 ws
135.031 289.86(Button,  TelltaleState,  and  TelltaleGroup  protocols.) 8 356.251 ws
newpath
16.24 281.69 moveto
16.24 282.69 lineto
412.24 282.69 lineto
412.24 281.69 lineto
closepath
gsave eofill grestore
showpage
%%Page: 5 5
90.05 36.94 translate
0 0 0 setrgbcolor
18 /Times-Bold sf
16 452.17(9.7) 3 38.5 as
51 452.17(Adjusters) 9 125.988 as
12 /Times-Roman sf
16 419.77(Scrollbars  and  mover  buttons  are  examples  of  interactive  objects  that  \252adjust\272  the) 22 412 ws
16 406.03(view  shown  by  another  object.   WidgetKit  provides  the  operations  shown  in) 21 412 ws
16 392.29(Figure  9.6  to  create  common  adjusters.) 10 202.973 ws
26.668 377.65(WidgetKit::hscroll_bar  and  WidgetKit::vscroll_bar  return  controls  for  scrolling) 12 412 ws
16 363.91(a  view  in  the  horizontal  and  vertical  dimensions,  respectively.   WidgetKit::panner) 19 412 ws
16 350.17(returns  a  control  for  scrolling  two  adjustables  at  once.   One  adjustable  is  controlled) 25 412 ws
16 336.43(by  the  horizontal  position  of  the  panner,  one  by  the  vertical  position.   Typically,) 25 412 ws
16 322.69(the  same  adjustable  is  passed  to  both  parameters  when  creating  a  panners.) 22 370.589 ws
394.8 39.12(9-) 2 404.796 as
407.796 39.12(5) 1 413.796 as
newpath
18.16 679.9 moveto
18.16 680.9 lineto
414.16 680.9 lineto
414.16 679.9 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
39.496 663.34(Button*  push_button\(const  String&,  Action*\)  const;) 8 262.947 ws
39.496 651.82(Button*  push_button\(Glyph*,  Action*\)  const;) 6 233.487 ws
39.496 640.3(Button*  default_button\(const  String&,  Action*\)  const;) 8 271.287 ws
39.496 628.78(Button*  default_button\(Glyph*,  Action*\)  const;) 6 241.827 ws
39.496 617.26(Button*  palette_button\(const  String&,  Action*\)  const;) 8 271.287 ws
39.496 605.74(Button*  palette_button\(Glyph*,  Action*\)  const;) 6 241.827 ws
39.496 594.22(Button*  check_box\(const  String&,  Action*\)  const;) 8 255.707 ws
39.496 582.7(Button*   check_box\(Glyph*,  Action*\)  const;) 7 227.637 ws
39.496 571.18(Button*  radio_button\(TelltaleGroup*,  const  String&,  Action*\)  const;) 10 332.966 ws
39.496 548.14(Glyph*  push_button_look\(Glyph*,  TelltaleState*\)  const;) 6 282.386 ws
39.496 536.62(Glyph*  default_button_look\(Glyph*,  TelltaleState*\)  const;) 6 290.726 ws
39.496 525.1(Glyph*  palette_button_look\(Glyph*,  TelltaleState*\)  const;) 6 290.726 ws
39.496 513.58(Glyph*  check_box_look\(Glyph*,  TelltaleState*\)  const;) 6 275.146 ws
39.496 502.06(Glyph*  radio_button_look\(Glyph*,  TelltaleState*\)  const;) 6 282.936 ws
10 /Helvetica sf
130.011 485.54(Figure  9.4:) 2 177.811 ws
186.141 485.54(WidgetKit  button  operations) 4 308.981 ws
newpath
18.16 477.37 moveto
18.16 478.37 lineto
414.16 478.37 lineto
414.16 477.37 lineto
closepath
gsave eofill grestore
showpage
%%Page: 6 6
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
394.8 39.12(9-) 2 404.796 as
407.796 39.12(6) 1 413.796 as
newpath
14.3201 653.98 moveto
14.3201 654.98 lineto
410.32 654.98 lineto
410.32 653.98 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
35.6561 637.42(Menu*  menubar\(\)  const,  *  pulldown\(\)  const,  *  pullright\(\)  const;) 16 308.527 ws
35.6561 625.9(MenuItem*  menubar_item\(const  String&\)  const;) 6 246.287 ws
35.6561 614.38(MenuItem*  menubar_item\(Glyph*\)  const;) 4 216.826 ws
35.6561 602.86(MenuItem*  menu_item\(const  String&\)  const;) 6 231.837 ws
35.6561 591.34(MenuItem*  menu_item\(Glyph*\)  const;) 4 202.376 ws
35.6561 579.82(MenuItem*  check_menu_item\(const  String&\)  const;) 6 263.516 ws
35.6561 568.3(MenuItem*  check_menu_item\(Glyph*\)  const;) 4 234.056 ws
35.6561 556.78(MenuItem*  radio_menu_item\(TelltaleGroup*,  Glyph*\)  const;) 6 299.636 ws
35.6561 545.26(MenuItem*  menu_item_separator\(\)  const;) 4 220.166 ws
35.6561 528.74(Glyph*  menubar_look\(\)  const,  pulldown_look\(\)  const,  pullright_look\(\)  const;) 12 367.996 ws
35.6561 517.22(Glyph*  menubar_item_look\(Glyph*,  TelltaleState*\)  const;) 6 287.416 ws
35.6561 505.7(Glyph*  menu_item_look\(Glyph*,  TelltaleState*\)  const;) 6 272.966 ws
35.6561 494.18(Glyph*  check_menu_item_look\(Glyph*,  TelltaleState*\)  const;) 6 304.646 ws
35.6561 482.66(Glyph*  radio_menu_item  _look\(Glyph*,  TelltaleState*\)  const;) 8 303.536 ws
35.6561 471.14(Glyph*  menu_item_separator_look\(\)  const;) 4 225.726 ws
35.6561 449.62(interface  MenuItem  :  Observer  {) 8 176.827 ws
43.9861 438.1(MenuItem\(Glyph*,  TelltaleState*\);) 2 192.926 ws
43.9861 426.58(Glyph*  body\(\)  const;) 4 134.577 ws
43.9861 415.06(TelltaleState*  state\(\)  const;) 4 164.037 ws
43.9861 403.54(void  action\(Action*\);) 2 132.906 ws
43.9861 392.02(Action*  action\(\)  const;) 4 141.247 ws
43.9861 380.5(void  menu\(Menu*,  Window*  =  nil\);) 8 194.867 ws
43.9861 368.98(Menu*  menu\(\)  const;) 4 136.797 ws
43.9861 357.46(Window*  window\(\)  const;) 4 155.677 ws
35.6561 345.94(};) 2 41.7761 as
35.6561 329.42(interface  Menu  :  InputHandler  {) 8 173.507 ws
43.9861 317.9(Menu\(Glyph*,  Style*,  float  x1,  float  y1,  float  x2,  float  y2\);) 18 291.327 ws
43.9861 306.38(void  append_item\(MenuItem*\);) 2 180.706 ws
43.9861 294.86(void  prepend_item\(MenuItem*\);) 2 184.036 ws
43.9861 283.34(void  insert_item\(GlyphIndex,  MenuItem*\);) 4 227.936 ws
43.9861 271.82(void  remove_item\(GlyphIndex\);) 2 182.916 ws
43.9861 260.3(void  replace_item\(GlyphIndex,  MenuItem*\);) 4 236.276 ws
43.9861 248.78(GlyphIndex  item_count\(\)  const;) 4 182.377 ws
43.9861 237.26(MenuItem*  item\(GlyphIndex\)  const;) 4 200.706 ws
43.9861 225.74(void  select\(GlyphIndex\);) 2 151.246 ws
43.9861 214.22(GlyphIndex  selected\(\)  const;) 4 170.707 ws
35.6561 202.7(};) 2 41.7761 as
10 /Helvetica sf
53.366 186.18(Figure  9.5:) 2 101.166 ws
109.496 186.18(WidgetKit  menu  operations,  menu,  and  menu  item  protocols.) 14 377.946 ws
newpath
14.3201 178.01 moveto
14.3201 179.01 lineto
410.32 179.01 lineto
410.32 178.01 lineto
closepath
gsave eofill grestore
showpage
%%Page: 7 7
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
394.8 39.12(9-) 2 404.796 as
407.796 39.12(7) 1 413.796 as
newpath
15.28 597.34 moveto
15.28 598.34 lineto
411.28 598.34 lineto
411.28 597.34 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
36.616 580.78(Glyph*  hslider\(Adjustable*\)  const;) 4 185.556 ws
36.616 569.26(Glyph*  hscroll_bar\(Adjustable*\)  const;) 4 205.006 ws
36.616 557.74(Glyph*  vslider\(Adjustable*\)  const;) 4 184.996 ws
36.616 546.22(Glyph*  vscroll_bar\(Adjustable*\)  const;) 4 204.446 ws
36.616 534.7(Glyph*  panner\(Adjustable*,  Adjustable*\)  const;) 6 243.376 ws
36.616 518.18(Stepper*  enlarger\(Adjustable*\)  const;) 4 201.686 ws
36.616 506.66(Stepper*  reducer\(Adjustabel*\)  const;) 4 198.906 ws
36.616 495.14(Stepper*  up_mover\(Adjustable*\)  const;) 4 209.466 ws
36.616 483.62(Stepper*  down_mover\(Adjustable*\)  const;) 4 222.246 ws
36.616 472.1(Stepper*  left_mover\(Adjustable*\)  const;) 4 211.686 ws
36.616 460.58(Stepper*  right_mover\(Adjustable*\)  const;) 4 217.796 ws
36.616 444.06(Glyph*  slider_look\(DimensionName,  Adjustable*\)  const;) 6 283.356 ws
36.616 432.54(Glyph*  scroll_bar_look\(DimensionName,  Adjustable*\)  const;) 6 302.806 ws
36.616 421.02(Glyph*  panner_look\(Adjustable*,  Adjustable*\)  const;) 6 267.276 ws
36.616 409.5(Glyph*  enlarger_look\(TelltaleState*\);) 2 198.896 ws
36.616 397.98(Glyph*  reducer_look\(TelltaleState*\);) 2 196.116 ws
36.616 386.46(Glyph*  up_mover_look\(TelltaleState*\);) 2 206.676 ws
36.616 374.94(Glyph*  down_mover_look\(TelltaleState*\);) 2 219.456 ws
36.616 363.42(Glyph*  left_mover_look\(TelltaleState*\);) 2 208.896 ws
36.616 351.9(Glyph*  right_mover_look\(TelltaleState*\);) 2 215.006 ws
10 /Helvetica sf
123.246 335.38(Figure  9.6:) 2 171.046 ws
179.376 335.38(WidgetKit  adjuster  operations) 4 309.986 ws
newpath
15.28 327.21 moveto
15.28 328.21 lineto
411.28 328.21 lineto
411.28 327.21 lineto
closepath
gsave eofill grestore
showpage
%%Trailer
end restore
%%Pages: 7
%!PS-Adobe-2.0
%%Creator: ./ch10.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
16 662.72(Chapter  10) 2 131.321 ws
16 625.76(DialogKit) 9 116.008 as
12 /Times-Roman sf
16 597.44(Whereas  WidgetKit  provides  operations  for  creating  common  look-and-feel) 14 412 ws
16 583.7(components  such  as  scrollbars,  menus,  and  buttons,  DialogKit  is  creates) 18 412 ws
16 569.96(higher-level  dialog  objects.   The  current  implementation  of  DialogKit  provides) 17 412 ws
16 556.22(only  field  editors  and  file  choosers,  but  in  the  future  this  kit  will  provide) 26 412 ws
16 542.48(operations  for  creating  confirmers,  quit  dialogs,  and  information  messages.   Figure) 19 412 ws
16 528.74(10.1  shows  the  operations  provided  by  DialogKit.) 12 255.317 ws
18 /Times-Bold sf
16 487.46(10.1) 4 47.5 as
51 487.46(Field  editor) 2 140.496 ws
12 /Times-Roman sf
16 455.06(Many  application  need  simple  editors  for  entering  or  browsing  data.   A  field  editor) 25 412 ws
16 441.32(is  suitable  for  incorporating  into  other  components,  such  as  a  dialog  box.   Figure) 25 412 ws
16 427.58(10.2  shows  the  field  editor  class  interface.) 12 217.961 ws
26.668 412.94(Clicking  inside  the  editor  \(or  calling  FieldEditor::edit\)  initiates  an  edit.) 18 412 ws
16 399.2(Subsequent  keyboard  events,  regardless  of  the  pointer  location,  are  interpreted  as) 20 412 ws
16 385.46(editing  operations  on  the  text.   Clicking  outside  the  editor  terminates  the  editing.) 23 401.152 ws
26.668 370.82(Text  is  selected  with  the  pointer  or  with  the  keyboard.   A  single  click  of  the  left) 31 412 ws
16 357.08(button  selects  a  new  insertion  point  between  characters.   Dragging  across  the  text) 23 412 ws
16 343.34(selects  a  range  of  characters.   A  set  of  control  characters  is  mapped  into  common) 27 412 ws
16 329.6(editing  operations.   A  character  not  specifically  associated  with  commands  is) 19 412 ws
16 315.86(inserted  in  place  of  the  current  selection,  the  replaced  text  is  discarded,  and) 24 412 ws
16 302.12(the  selection  becomes  an  insertion  point  following  the  inserted  character.   The) 21 412 ws
16 288.38(commands  defined  are:) 4 127.973 ws
37.336 268.94(character-left  \(^B\)) 2 125.92 ws
37.336 255.5(character-right  \(^F\)) 2 131.26 ws
37.336 242.06(beginning-of-text  \(^A\)) 2 146.608 ws
37.336 228.62(end-of-text  \(^E\)) 2 114.604 ws
37.336 215.18(erase  \(^H  or  DEL\)) 6 126.593 ws
37.336 201.74(delete  \(^D\)) 2 91.2764 ws
37.336 188.3(select-all  \(^U\)) 2 105.94 ws
37.336 174.86(select-word\(^W\)) 15 118.264 as
16 155.42(Strings  that  are  too  long  to  fit  into  the  editor  can  be  scrolled  horizontally.   Clicking) 29 412 ws
16 141.68(the  middle  button  inside  the  editor  initiates  \252grab-scrolling\272.   While  the  button  is) 23 412 ws
16 127.94(down  the  editor  scrolls  the  text  to  follow  the  pointer,  giving  the  appearance  that) 26 412 ws
16 114.2(the  user  is  dragging  the  text.   Clicking  the  right  button  engages  \252rate-scrolling\272,  a) 25 412 ws
16 100.46(joy-stick-like  scrolling  interface  in  which  the  scrolling  rate  increases  as  the  user) 22 412 ws
16 86.72(drags  the  pointer  away  from  the  initial  click  location.) 16 270.965 ws
26.668 72.08(The  field  editor  constructor  is  passed  a  sample  string,  used  to  compute  its) 24 412 ws
394.8 39.12(10-) 3 410.796 as
413.796 39.12(1) 1 419.796 as
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 523.17(natural  size,  a  style  for  customization,  and  a  field  editor  action  to  execute  when) 26 412 ws
16 509.43(editing  returns.   Editing  normally  completes  when  a  carriage  return  or  tab  is) 23 412 ws
16 495.69(entered;  abnormally  when  an  escape  character  is  entered.) 14 289.901 ws
26.668 481.05(FieldEditor::field  sets  the  contents  of  the  string  being  edited.   FieldEditor::select) 19 412 ws
16 467.31(sets  the  insertion  point  or  subrange  within  the  edit  string.   FieldEditor::edit) 21 412 ws
16 453.57(initiates  an  edit.   Specifying  a  string  and  selection  range  is  short-hand  for  first) 25 412 ws
16 439.83(calling  FieldEditor::field  and  FieldEditor::select.   FieldEditor::text  returns  the) 13 412 ws
16 426.09(current  value  of  the  string  being  edited.   The  caller  must  copy  the  string  to  save) 29 412 ws
16 412.35(the  contents,  as  it  will  be  modified  by  a  subsequent  edit.) 20 285.318 ws
394.8 39.12(10-) 3 410.796 as
413.796 39.12(2) 1 419.796 as
newpath
16.24 678.94 moveto
16.24 679.94 lineto
412.24 679.94 lineto
412.24 678.94 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.576 662.38(interface  DialogKit  {) 4 124.837 ws
45.906 650.86(static  DialogKit*  instance\(\);) 4 165.387 ws
45.906 639.34(FieldEditor*  field_editor\() 2 152.606 ws
54.236 627.82(const  String&  sample,  Style*,  FieldEditorAction*  =  nil) 12 286.827 ws
45.906 615.3(\)  const;) 2 78.6964 ws
45.906 603.78(FileChooser*  file_chooser\() 2 163.716 ws
54.236 592.26(constString&  dir,  Style*,  FileChooserAction*  =  nil) 10 269.037 ws
45.906 580.74(\)  const;) 2 78.6964 ws
37.576 569.22(};) 2 43.696 as
10 /Helvetica sf
141.991 552.7(Figure  10.1:) 2 195.351 ws
203.681 552.7(DialogKit  operations) 2 293.161 ws
newpath
16.24 544.53 moveto
16.24 545.53 lineto
412.24 545.53 lineto
412.24 544.53 lineto
closepath
gsave eofill grestore
newpath
13.36 369.82 moveto
13.36 370.82 lineto
409.36 370.82 lineto
409.36 369.82 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
34.696 353.26(interface  FieldEditorAction   Resource  {) 7 204.487 ws
43.026 341.74(void  execute\(FieldEditor*,  boolean  accept\);) 6 233.667 ws
34.696 330.22(};) 2 40.816 as
34.696 313.7(interface  FieldEditorCallback\(T\)  :  FieldEditorAction  {) 8 264.767 ws
43.026 302.18(FieldEditorCallback\(T\)\(T*,  void  \(T::*\)\(FieldEditor*,  boolean  accept\)\);) 8 341.986 ws
34.696 290.66(};) 2 40.816 as
34.696 274.14(interface  FieldEditor  :  InputHandler  {) 8 195.327 ws
43.026 262.62(FieldEditor\(const  char*  sample,  Style*,  FieldEditorAction*  =  nil\);) 12 323.396 ws
43.026 251.1(FieldEditor\(const  String&  sample,  Style*,  FieldEditorAction*  =  nil\);) 12 332.846 ws
43.026 234.58(void  field\(const  char*\);) 4 141.947 ws
43.026 223.06(void  field\(const  String&\);) 4 151.397 ws
43.026 211.54(void  select\(int  pos\);) 4 129.167 ws
43.026 200.02(void  select\(int  left,  int  right\);) 8 164.737 ws
43.026 188.5(void  edit\(\);) 2 89.7064 ws
43.026 176.98(void  edit\(const  char*,  int  left,  int  right\);) 12 210.317 ws
43.026 165.46(void  edit\(const  String&,  int  left,  int  right\);) 12 219.767 ws
43.026 153.94(const  char*  text\(\)  const;) 6 148.067 ws
43.026 142.42(void  text\(String&\)  const;) 4 149.177 ws
34.696 130.9(};) 2 40.816 as
10 /Helvetica sf
124.386 114.38(Figure  10.2:) 2 177.746 ws
186.076 114.38(Field  editor  class  interface.) 6 305.006 ws
newpath
13.36 106.21 moveto
13.36 107.21 lineto
409.36 107.21 lineto
409.36 106.21 lineto
closepath
gsave eofill grestore
showpage
%%Page: 3 3
90.05 36.94 translate
0 0 0 setrgbcolor
18 /Times-Bold sf
16 544.33(10.2) 4 47.5 as
51 544.33(Dialog) 6 101.004 as
12 /Times-Roman sf
16 511.93(A  dialog  is  an  object  that  can  be  posted  temporarily  and  grabs  input  until  it  is) 30 412 ws
16 498.19(dismissed.   Figure  10.3  shows  the  Dialog  protocol.   Dialog::post_for  creates  a) 20 412 ws
16 484.45(transient  window  for  the  dialog  and  aligns  over  the  given  window  using  the  given) 26 412 ws
16 470.71(x  and  y  alignment.   The  default  is  for  the  dialog  to  be  centered  over  the  window.) 31 400.432 ws
26.668 456.07(Dialog::post_at  creates  a  top-level  window  aligned  around  the  given  position.) 18 412 ws
16 442.33(Dialog::run  blocks  until  Dialog::dismiss  is  called,  and  Dialog::run  returns  the) 18 412 ws
16 428.59(value  of  the  parameter  that  is  passed  to  Dialog::dismiss.) 16 284.309 ws
18 /Times-Bold sf
16 387.31(10.3) 4 47.5 as
51 387.31(FileChooser) 11 143.988 as
12 /Times-Roman sf
16 354.91(A  file  chooser  is  a  dialog  subclass  that  allows  the  user  to  select  a  file  in  a  directory) 34 412 ws
16 341.17(and  returns  the  file  name.   Figure  10.4  shows  the  FileChooser  protocol.) 21 356.465 ws
394.8 39.12(10-) 3 410.796 as
413.796 39.12(3) 1 419.796 as
newpath
14.32 679.9 moveto
14.32 680.9 lineto
410.32 680.9 lineto
410.32 679.9 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
35.656 663.34(interface  DIalog  :  InputHandler  {) 8 177.397 ws
43.986 651.82(Dialog\(Glyph*,  Style*\);) 2 143.456 ws
43.986 640.3(boolean  post_for\(Window*,  float  =  0.5,  float  =  0.5\);) 14 266.887 ws
43.986 628.78(boolean  post_at\(Coord  x,  Coord  y,  float  =  0.5,  float  =  0.5\);) 20 299.687 ws
43.986 617.26(boolean  run\(\);) 2 106.236 ws
43.986 605.74(void  dismiss\(boolean  accept\);) 4 175.697 ws
35.656 594.22(};) 2 41.776 as
10 /Helvetica sf
151.466 577.7(Figure  10.3:) 2 204.826 ws
213.156 577.7(Dialog  protocol) 2 279.846 ws
newpath
14.32 569.53 moveto
14.32 570.53 lineto
410.32 570.53 lineto
410.32 569.53 lineto
closepath
gsave eofill grestore
newpath
16.24 277.66 moveto
16.24 278.66 lineto
412.24 278.66 lineto
412.24 277.66 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.576 261.1(interface  FileChooserAction  :  Resource  {) 8 217.647 ws
45.906 249.58(void  execute\(FileChooser*,  boolean  accept\);) 6 242.656 ws
37.576 238.06(};) 2 43.696 as
37.576 221.54(interface  FileChooserCallback\(T\)  :  FileChooserAction  {) 8 279.867 ws
45.906 210.02(FileChooserCallback\(T\)\(T*,  void  \(T::*\)\(FileChooser*,  boolean  accept\)\);) 8 357.086 ws
37.576 198.5(};) 2 43.696 as
37.576 181.98(interface  FileChooser  :  Dialog  {) 8 175.407 ws
45.906 170.46(const  String*  selected\(\)  const;) 6 178.737 ws
45.906 158.94(void  reread\(\);) 2 105.366 ws
37.576 147.42(};) 2 43.696 as
10 /Helvetica sf
140.606 130.9(Figure  10.4:) 2 193.966 ws
202.296 130.9(FileChooser  protocol) 2 294.546 ws
newpath
16.24 122.73 moveto
16.24 123.73 lineto
412.24 123.73 lineto
412.24 122.73 lineto
closepath
gsave eofill grestore
showpage
%%Trailer
end restore
%%Pages: 3
%!PS-Adobe-2.0
%%Creator: ./ch11.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
16 662.72(Chapter  11) 2 131.321 ws
16 625.76(LayoutKit) 9 122.68 as
12 /Times-Roman sf
16 597.44(Composite  glyphs  usually  manage  the  physical  layout  of  their  children.) 18 412 ws
16 583.7(LayoutKit  provides  operations  for  creating  objects  that  are  useful  in  managing  the) 22 412 ws
16 569.96(arrangement  of  one  or  more  glyphs.   The  LayoutKit  objects  are  modelled  after  the) 25 412 ws
16 556.22(Knuth's  TeX  document  processing  system.) 8 222.977 ws
18 /Times-Bold sf
16 514.94(11.1) 4 47.5 as
51 514.94(Boxes) 5 96 as
12 /Times-Roman sf
16 482.54(A  box  is  a  polyglyph  that  uses  a  layout  object  to  arrange  its  components.  A  layout) 30 412 ws
16 468.8(object  is  not  a  glyph,  but  helps  a  glyph  manage  the  requests  and  allocations  of) 28 412 ws
16 455.06(component  glyphs.  Figure  11.1  shows  the  Layout  protocol  and  the  LayoutKit) 20 412 ws
16 441.32(operations  that  create  boxes.) 6 152.633 ws
26.668 426.68(Layout::request  is  given  an  array  of  requisitions  for  the  individual  components) 20 412 ws
16 412.94(and  computes  a  single  requisition  for  the  result.   Layout::allocate  is  given  the) 23 412 ws
16 399.2(requisitions  of  the  components  and  the  overall  allocation,  returning  the  allocations) 20 412 ws
16 385.46(of  the  individual  components.) 6 159.329 ws
26.668 370.82(A  box  can  be  constructed  either  with  a  list  of  up  to  10  initial  glyph  components,) 30 412 ws
16 357.08(or  an  initial  size  estimate  on  the  number  of  components.   The  size  is  not  a) 29 412 ws
16 343.34(maximum,  but  can  avoid  growing  the  list  dynamically.) 14 278.993 ws
26.668 328.7(LayoutKit::hbox  returns  a  box  that  tiles  its  components  in  the  X) 20 412 ws
16 314.96(dimension  left-to-right  and  aligns  the  component  origins  in  the  Y  dimension.) 20 412 ws
16 301.22(LayoutKit::vbox  returns  a  box  that  tiles  top-to-bottom  and  aligns  in  the  X) 22 412 ws
16 287.48(dimension.   LayoutKit::overlay  aligns  in  both  the  X  and  Y  dimensions,  drawing) 21 412 ws
16 273.74(the  components  in  back-to-front  order.) 8 201.629 ws
26.668 259.1(LayoutKit::hbox  returns  a  box  with  its  X  origin  at  the  left  side  of  the) 26 412 ws
16 245.36(box;  LayoutKit::vbox  returns  a  box  with  its  Y  origin  at  the  top  of  the  box.) 28 412 ws
16 231.62(Sometimes  it  is  more  convenient  to  have  the  origin  correspond  to  the  origin) 24 412 ws
16 217.88(of  the  first  component.   For  example,  a  column  of  text  might  want  to  have) 27 412 ws
16 204.14(its  Y  origin  correspond  to  the  base  line  of  the  first  line  of  text.   When  the) 31 412 ws
16 190.4(aligment  should  correspond  to  the  first  component's  alignment,  one  can  use) 20 412 ws
16 176.66(LayoutKit::hbox_first_aligned  or  LayoutKit::vbox_first_aligned.) 4 328.324 ws
26.668 162.02(A  ) 2 40.916 ws
12 /Times-Italic sf
40.916 162.02(deck) 4 62.9 as
12 /Times-Roman sf
62.9 162.02(  is  a  polyglyph  similar  in  some  ways  to  an  overlay  box.   However,) 25 412 ws
16 148.28(instead  of  overlaying  its  components,  a  deck  is  a  polyglyph  where  only  one  of  the) 28 412 ws
16 134.54(components  is  visible  at  any  time.   Figure  11.2  shows  the  deck  protocol  and  the) 27 412 ws
16 120.8(LayoutKit  operations  to  create  decks.) 8 195.629 ws
26.668 106.16(Deck::flip_to  sets  which  component  should  currently  be  visible;   Deck::card) 17 412 ws
16 92.42(returns  the  current  top.   The  natural  size  of  a  deck  is  the  maximum  size  of  the) 31 412 ws
16 78.68(natural  sizes  of  its  components.   A  deck  can  be  stretched  to  be  as  large  as  its) 31 412 ws
16 64.94(largest   fully-stretched  component.) 5 181.805 ws
388.72 36.08(11-) 3 404.716 as
407.716 36.08(1) 1 413.716 as
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
18 /Times-Bold sf
16 245.37(11.2) 4 47.5 as
51 245.37(Glue) 4 88.008 as
12 /Times-Roman sf
16 212.97(Boxes  stretch  or  shrink  their  components  to  fit  the  available  space.   However,) 23 412 ws
16 199.23(many  components  are  rigid.   For  example,  characters  in  text  typically  do  not) 23 412 ws
16 185.49(stretch  or  shrink.   Instead,  we  prefer  to  stretch  or  shrink  the  white  space  between) 27 412 ws
16 171.75(words.   In  TeX,  this  flexible  white  space  is  referred  to  as  \252glue\272.) 23 324.089 ws
26.668 157.11(LayoutKit  provides  the  set  of  operations  to  create  glue  object  shown  in  Figure) 24 412 ws
16 143.37(11.3.   LayoutKit::glue  is  the  most  general  operation.   It  can  either  be  passed  a) 26 412 ws
16 129.63(specific  dimension,  natural  size,  stretchability,  shrinkability,  and  alignment,  or  it) 18 412 ws
16 115.89(can  be  passed  a  complete  requisition.) 10 194.633 ws
26.668 101.25(LayoutKit::hglue  and  LayoutKit::vglue  can  create  glue  that  is  horizontally  or) 18 412 ws
16 87.51(vertically  stretchable,  respectively.   The  requirement  in  the  minor  dimension  is) 19 412 ws
16 73.77(undefined.   If  no  parameters  are  passed  to  LayoutKit::hglue  or  vglue,  then  a) 23 412 ws
16 60.03(natural  size  of  zero  is  assumed.   If  no  stretchability  is  specified,  then  the  glue  is) 29 412 ws
388.72 36.08(11-) 3 404.716 as
407.716 36.08(2) 1 413.716 as
newpath
17.2 678.94 moveto
17.2 679.94 lineto
413.2 679.94 lineto
413.2 678.94 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.536 662.38(interface  Layout  {) 4 115.807 ws
46.866 650.86(void  request\(GlyphIndex  count,  const  Requisition*,  Requisition&  result\);) 12 363.106 ws
46.866 639.34(void  allocate\() 2 105.776 ws
55.196 627.82(const  Allocation&  given,  GlyphIndex  count,  const  Requisition*,) 12 330.326 ws
55.196 616.3(Allocation*  result) 2 129.666 ws
46.866 604.78(\);) 2 52.976 as
38.536 593.26(};) 2 44.656 as
38.536 571.74(PolyGlyph*  box\(Layout*,  GlyphIndex  size  =  10\)  const;) 12 276.147 ws
38.536 560.22(PolyGlyph*  hbox\(GlyphIndex  size\)  const;) 6 219.717 ws
38.536 548.7(PolyGlyph*  hbox\() 2 115.786 ws
46.866 537.18(Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,) 28 328.937 ws
46.866 525.66(Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil) 28 326.157 ws
38.536 514.14(\)  const;) 2 71.3264 ws
38.536 502.62(PolyGlyph*  vbox\(GlyphIndex  size\)  const;) 6 219.157 ws
38.536 491.1(PolyGlyph*  vbox\() 2 115.226 ws
46.866 479.58(Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,) 28 328.937 ws
46.866 468.06(Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil) 28 326.157 ws
38.536 456.54(\)  const;) 2 71.3264 ws
38.536 445.02(PolyGlyph*  hbox_first_aligned\(GlyphIndex  size\)  const;) 6 279.186 ws
38.536 433.5(PolyGlyph*  hbox_first_aligned\() 2 175.256 ws
46.866 421.98(Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,) 28 328.937 ws
46.866 410.46(Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil) 28 326.157 ws
38.536 398.94(\)  const;) 2 71.3264 ws
38.536 387.42(PolyGlyph*  vbox_first_aligned\(GlyphIndex  size\)  const;) 6 278.626 ws
38.536 375.9(PolyGlyph*  vbox_first_aligned\() 2 174.696 ws
46.866 364.38(Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,) 28 328.937 ws
46.866 352.86(Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil) 28 326.157 ws
38.536 341.34(\)  const;) 2 71.3264 ws
38.536 329.82(PolyGlyph*  overlay\() 2 126.336 ws
46.866 318.3(Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,) 28 328.937 ws
46.866 306.78(Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil) 28 326.157 ws
38.536 295.26(\)  const;) 2 71.3264 ws
10 /Helvetica sf
87.3559 278.74(Figure  11.1:) 2 140.716 ws
149.046 278.74(Layout  protocol  and  LayoutKit  box  operations) 10 349.716 ws
newpath
17.2 270.57 moveto
17.2 271.57 lineto
413.2 271.57 lineto
413.2 270.57 lineto
closepath
gsave eofill grestore
showpage
%%Page: 3 3
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 521.09(assumed  to  be  infinitely  stretchable.) 8 188.981 ws
26.668 506.45(LayoutKit::hspace  and  LayoutKit::vspace  create  glue  with  a  given  size  that  is) 20 412 ws
16 492.71(rigid.   LayoutKit::shape_of  returns  glue  that  has  the  same  requisition  as  another) 21 412 ws
16 478.97(glyph.   LayoutKit::shape_of_xy  returns  glue  that  takes  its  X  requirement  from  one) 21 412 ws
16 465.23(glyph  and  its  Y  requirement  from  another  glyph.) 14 249.305 ws
26.668 450.59(LayoutKit::spaces  returns  glue  that  correspond  to  a  given  number  of  spaces  in) 22 412 ws
388.72 36.08(11-) 3 404.716 as
407.716 36.08(3) 1 413.716 as
newpath
17.2 680.86 moveto
17.2 681.86 lineto
413.2 681.86 lineto
413.2 680.86 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.536 664.3(interface  Deck  :  PolyGlyph  {) 8 162.477 ws
46.866 652.78(GlyphIndex  card\(\)  const;) 4 155.797 ws
46.866 641.26(void  flip_to\(GlyphIndex\);) 2 154.686 ws
38.536 629.74(};) 2 44.656 as
38.536 613.22(Deck*  deck\(GlyphIndex  size\)  const;) 6 196.367 ws
38.536 601.7(Deck*  deck\() 2 92.4363 ws
46.866 590.18(Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,) 28 328.937 ws
46.866 578.66(Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil,  Glyph*  =  nil) 28 326.157 ws
38.536 567.14(\)  const;) 2 71.3263 ws
10 /Helvetica sf
100.426 550.62(Figure  11.2:) 2 153.786 ws
162.116 550.62(Deck  protocol  and  LayoutKit  operations) 8 336.646 ws
newpath
17.2 542.45 moveto
17.2 543.45 lineto
413.2 543.45 lineto
413.2 542.45 lineto
closepath
gsave eofill grestore
newpath
14.32 422.62 moveto
14.32 423.62 lineto
410.32 423.62 lineto
410.32 422.62 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
35.656 406.06(Glyph*  glue\() 2 90.6764 ws
43.986 394.54(DimensionName,  Coord  natural,  Coord  stretch,  Coord  shrink,  float  alignment) 16 382.436 ws
35.656 383.02(\)  const;) 2 68.4464 ws
35.656 371.5(Glyph*  glue\(const  Requisition&\)  const;) 6 206.277 ws
35.656 359.98(Glyph*  hglue\(\)  const;) 4 129.027 ws
35.656 348.46(Glyph*  hglue\(Coord  natural\)  const;) 6 189.607 ws
35.656 336.94(Glyph*  hglue\(Coord  natural,  Coord  stretch,  Coord  shrink\)  const;) 14 317.427 ws
35.656 325.42(Glyph*  hglue\(Coord  natural,  Coord  stretch,  Coord  shrink,  float  alignment\)  const;) 18 388.016 ws
35.656 308.9(Glyph*  vglue\(\)  const;) 4 128.467 ws
35.656 297.38(Glyph*  vglue\(Coord  natural\);) 4 162.367 ws
35.656 285.86(Glyph*  vglue\(Coord  natural,  Coord  stretch,  Coord  shrink\)  const;) 14 316.867 ws
35.656 274.34(Glyph*  vglue\(Coord  natural,  Coord  stretch,  Coord  shrink,  float  alignment\)  const;) 18 387.456 ws
35.656 257.82(Glyph*  hspace\(Coord\)  const;) 4 164.037 ws
35.656 246.3(Glyph*  vspace\(Coord\)  const;) 4 163.477 ws
35.656 234.78(Glyph*  shape_of\(Glyph*\)  const;) 4 175.716 ws
35.656 223.26(Glyph*  shape_of_xy\(Glyph*,  Glyph*\)  const;) 6 226.847 ws
35.656 206.74(Glyph*  spaces\(int  count,  Coord  each,  const  Font*,  const  Color*\)  const;) 18 347.456 ws
35.656 195.22(Glyph*  strut\() 2 91.2264 ws
43.986 183.7(const  Font*,  Coord  natural  =  0,  Coord  stretch  =  0,  Coord  shrink  =  0) 26 339.407 ws
35.656 172.18(\)  const;) 2 68.4464 ws
35.656 160.66(Glyph*  hstrut\() 2 96.7863 ws
43.986 149.14(Coord  right_bearing,  Coord  left_bearing  =  0,) 10 239.917 ws
43.986 137.62(Coord  natural  =  0,  Coord  stretch  =  0,  Coord  shrink  =  0) 22 283.267 ws
35.656 126.1(\)  const;) 2 68.4464 ws
35.656 114.58(Glyph*  vstrut\() 2 96.2263 ws
43.986 103.06(Coord  ascent,  Coord  descent  =  0,) 10 193.787 ws
43.986 91.5401(Coord  natural  =  0,  Coord  stretch  =  0,  Coord  shrink  =  0) 22 283.267 ws
35.656 80.0201(\)  const;) 2 68.4464 ws
10 /Helvetica sf
78.3709 63.5001(Figure  11.3:) 2 131.731 ws
140.061 63.5001(LayoutKit  operations  for  creating  spacing  glyphs) 10 352.941 ws
newpath
14.32 55.33 moveto
14.32 56.33 lineto
410.32 56.33 lineto
410.32 55.33 lineto
closepath
gsave eofill grestore
showpage
%%Page: 4 4
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 360.77(the  current  font.   Unlike  other  glue  objects,  which  despite  being  generally  referred) 23 412 ws
16 347.03(to  as  \252white  space\272  do  not  actually  have  an  appearance,  spaces  are  drawn  in  the) 28 412 ws
16 333.29(given  color.) 2 73.3244 ws
18 /Times-Bold sf
16 292.01(11.3) 4 47.5 as
51 292.01(Alignment) 9 132 as
12 /Times-Roman sf
16 259.61(In  addition  to  laying  out  a  collection  of  glyphs,  it  is  often  desirable  to  modify  the) 30 412 ws
16 245.87(positioning  of  a  single  glyph.   LayoutKit  provides  operations  to  adjust  the  layout) 23 412 ws
16 232.13(of  a  glyph.   These  operations  return  a  monoglyph.) 15 254.465 ws
26.668 217.49(Figure  11.4  shows  the  operations  that  affect  the  requisition  of  a  glyph.) 22 412 ws
16 203.75(LayoutKit::center  ,  center_dimension,  hcenter,  and  vcenter  change  the  origin  of  a) 20 412 ws
16 190.01(glyph  as  it  appears  in  a  requisition.   When  the  glyph  body  is  allocated,  it  is  given) 31 412 ws
16 176.27(the  origin  it  requested.   Thus,  the  name  \252center\272  is  somewhat  misleading  as  these) 25 412 ws
16 162.53(monoglyphs  merely  return  a  glyph  that  asks  to  be  centered  at  a  particular  position,) 26 412 ws
16 148.79(they  do  not  actually  change  the  origin  themselves.) 14 256.637 ws
26.668 134.15(LayoutKit::fixed,  fixed_dimension,  hfixed,  and  vfixed  change  a  glyph  to  appear) 18 412 ws
16 120.41(rigid  even  if  it  is  flexible.   Fixed  monoglyphs  are  ideal  for  specifying  sizes) 25 412 ws
16 106.67(that  are  otherwise  undefined,  such  as  the  initial  height  of  a  file  chooser.   The) 27 412 ws
16 92.9299(inverse  functionality\261making  a  glyph  flexible  that  may  be  rigid\261is  provided  by) 20 412 ws
16 79.1899(the  LayoutKit::flexible,  flexible_dimension,  hflexible,  and  vflexible  operations.) 12 412 ws
16 65.4499(The  LayoutKit::natural,  natural_dimension,  hnatural,  and  vnatural  operations  are) 14 412 ws
388.72 36.08(11-) 3 404.716 as
407.716 36.08(4) 1 413.716 as
newpath
15.28 670.3 moveto
15.28 671.3 lineto
411.28 671.3 lineto
411.28 670.3 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
36.616 653.74(MonoGlyph*  center\(Glyph*,  float  x  =  0.5,  float  y  =  0.5\)  const;) 20 303.417 ws
36.616 642.22(MonoGlyph*  center_dimension\(Glyph*,  DimensionName,  float  align\)  const;) 10 367.286 ws
36.616 630.7(MonoGlyph*  hcenter\(Glyph*,  float  x  =  0.5\)  const;) 12 251.437 ws
36.616 619.18(MonoGlyph*  vcenter\(Glyph*,  float  y  =  0.5\)  const;) 12 250.877 ws
36.616 602.66(MonoGlyph*  fixed\(Glyph*,  Coord  x,  Coord  y\)  const;) 12 262.807 ws
36.616 591.14(MonoGlyph*  fixed_dimension\(Glyph*,  DimensionName,  Coord\)  const;) 8 345.046 ws
36.616 579.62(MonoGlyph*  hfixed\(Glyph*,  Coord  x\)  const;) 8 227.797 ws
36.616 568.1(MonoGlyph*  vfixed\(Glyph*,  Coord  y\)  const;) 8 227.237 ws
36.616 556.58(MonoGlyph*  flexible\(Glyph*,  Coord  stretch  =  fil,  Coord  shrink  =  fil\)  const;) 20 356.726 ws
36.616 545.06(MonoGlyph*  flexible_dimension\() 2 179.996 ws
44.946 533.54(Glyph*,  DimensionName,  Coord  stretch  =  fil,  Coord  shrink  =  fil) 18 319.477 ws
36.616 522.02(\)  const;) 2 69.4064 ws
36.616 510.5(MonoGlyph*  hflexible\() 2 134.426 ws
44.946 498.98(Glyph*,  Coord  stretch  =  fil,  Coord  shrink  =  fil) 16 240.017 ws
36.616 487.46(\)  const;) 2 69.4064 ws
36.616 475.94(MonoGlyph*  vflexible\() 2 133.866 ws
44.946 464.42(Glyph*,  Coord  stretch  =  fil,  Coord  shrink  =  fil) 16 240.017 ws
36.616 452.9(\)  const;) 2 69.4064 ws
36.616 441.38(MonoGlyph*  natural\(Glyph*,  Coord  x,  Coord  y\)  const;) 12 272.257 ws
36.616 429.86(MonoGlyph*  natural_dimension\(Glyph*,  DimensionName,  Coord\)  const;) 8 354.496 ws
36.616 418.34(MonoGlyph*  hnatural\(Glyph*,  Coord\)  const;) 6 229.467 ws
36.616 406.82(MonoGlyph*  vnatural\(Glyph*,  Coord\)  const;) 6 228.907 ws
10 /Helvetica sf
92.6658 390.3(Figure  11.4:) 2 146.026 ws
154.356 390.3(LayoutKit  operations  that  adjust  alignment) 8 340.566 ws
newpath
15.28 382.13 moveto
15.28 383.13 lineto
411.28 383.13 lineto
411.28 382.13 lineto
closepath
gsave eofill grestore
showpage
%%Page: 5 5
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 235.21(similar  to  the  fixed  operations  in  that  they  change  the  natural  size,  but  they  do  not) 30 412 ws
16 221.47(affect  the  flexibility.) 4 114.317 ws
26.668 206.83(LayoutKit  also  provides  a  set  of  operations  to  put  a  margin  around  a  glyph.) 26 412 ws
16 193.09(These  operations  are  shown  in  Figure  11.5.   LayoutKit::margin  is  overloaded  to) 21 412 ws
16 179.35(specify  a  fixed  margin  around  the  entire  glyph,  distinct  horizontal  and  vertical) 22 412 ws
16 165.61(margins,  separate  left,  right,  bottom,  and  top  margins,  or  flexible  margins  on) 22 412 ws
16 151.87(each  side.   LayoutKit::hmargin  specifies  horizontal  margins;  LayoutKit::vmargin) 13 412 ws
16 138.13(specifies  vertical  margins.   LayoutKit::lmargin,  rmargin,  bmargin,  and  tmargin) 15 412 ws
16 124.39(specify  left,  right,  bottom,  and  top  margins,  respectively.) 14 288.641 ws
388.72 36.08(11-) 3 404.716 as
407.716 36.08(5) 1 413.716 as
newpath
15.28 677.98 moveto
15.28 678.98 lineto
411.28 678.98 lineto
411.28 677.98 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
36.616 661.42(MonoGlyph*  margin\(Glyph*,  Coord\)  const;) 6 223.897 ws
36.616 649.9(MonoGlyph*  margin\(Glyph*,  Coord  hmargin,  Coord  vmargin\)  const;) 12 333.926 ws
36.616 638.38(MonoGlyph*  margin\() 2 128.306 ws
44.946 626.86(Glyph*,  Coord  lmargin,  Coord  rmargin,  Coord  bmargin,  Coord  tmargin) 16 353.366 ws
36.616 615.34(\)  const;) 2 69.4064 ws
36.616 603.82(MonoGlyph*  margin\() 2 128.306 ws
44.946 592.3(Glyph*,) 7 77.736 as
44.946 580.78(Coord  lmargin,  Coord  lstretch,  Coord  lshrink,) 10 242.777 ws
44.946 569.26(Coord  rmargin,  Coord  rstretch,  Coord  rshrink,) 10 246.107 ws
44.946 557.74(Coord  bmargin,  Coord  bstretch,  Coord  bshrink,) 10 252.797 ws
44.946 546.22(Coord  tmargin,  Coord  tstretch,  Coord  tshrink) 10 241.677 ws
36.616 534.7(\)  const;) 2 69.4064 ws
36.616 523.18(MonoGlyph*  hmargin\(Glyph*,  Coord\)  const;) 6 229.457 ws
36.616 511.66(MonoGlyph*  hmargin\(Glyph*,  Coord  lmargin,  Coord  rmargin\)  const;) 12 334.476 ws
36.616 500.14(MonoGlyph*  hmargin\() 2 133.866 ws
44.946 488.62(Glyph*,) 7 77.736 as
44.946 477.1(Coord  lmargin,  Coord  lstretch,  Coord  lshrink,) 10 242.777 ws
44.946 465.58(Coord  rmargin,  Coord  rstretch,  Coord  rshrink) 10 243.327 ws
36.616 454.06(\)  const;) 2 69.4064 ws
36.616 442.54(MonoGlyph*  vmargin\(Glyph*,  Coord\)  const;) 6 228.897 ws
36.616 431.02(MonoGlyph*  vmargin\(Glyph*,  Coord  lmargin,  Coord  rmargin\)  const;) 12 333.916 ws
36.616 419.5(MonoGlyph*  vmargin\() 2 133.306 ws
44.946 407.98(Glyph*,) 7 77.736 as
44.946 396.46(Coord  bmargin,  Coord  bstretch,  Coord  bshrink,) 10 252.797 ws
44.946 384.94(Coord  tmargin,  Coord  tstretch,  Coord  tshrink) 10 241.677 ws
36.616 373.42(\)  const;) 2 69.4064 ws
36.616 361.9(MonoGlyph*  lmargin\(Glyph*,  Coord\)  const;) 6 226.117 ws
36.616 350.38(MonoGlyph*  lmargin\(Glyph*,  Coord  nat,  Coord  stretch,  Coord  shrink\)  const;) 16 370.616 ws
36.616 338.86(MonoGlyph*  rmargin\(Glyph*,  Coord\)  const;) 6 227.227 ws
36.616 327.34(MonoGlyph*  rmargin\(Glyph*,  Coord  nat,  Coord  stretch,  Coord  shrink\)  const;) 16 371.726 ws
36.616 315.82(MonoGlyph*  bmargin\(Glyph*,  Coord\)  const;) 6 229.457 ws
36.616 304.3(MonoGlyph*  bmargin\(Glyph*,  Coord  nat,  Coord  stretch,  Coord  shrink\)  const;) 16 373.956 ws
36.616 292.78(MonoGlyph*  tmargin\(Glyph*,  Coord\)  const;) 6 226.677 ws
36.616 281.26(MonoGlyph*  tmargin\(Glyph*,  Coord  nat,  Coord  stretch,  Coord  shrink\)  const;) 16 371.176 ws
10 /Helvetica sf
123.521 264.74(Figure  11.5:) 2 176.881 ws
185.211 264.74(LayoutKit  margin  operations) 4 309.711 ws
newpath
15.28 256.57 moveto
15.28 257.57 lineto
411.28 257.57 lineto
411.28 256.57 lineto
closepath
gsave eofill grestore
showpage
%%Trailer
end restore
%%Pages: 5
%!PS-Adobe-2.0
%%Creator: ./ch12.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
16 662.72(Chapter  12) 2 131.321 ws
16 625.76(DocumentKit) 11 154.648 as
12 /Times-Roman sf
16 597.44(In  Chapter  11,  we  described  the  LayoutKit  class,  which  provides  operations) 20 412 ws
16 583.7(for  creating  layout  objects.   The  DocumentKit  class  will  provide  operations) 19 412 ws
16 569.96(for  creating  document  objects  that  use  LayoutKit  objects  to  produce  formatted) 20 412 ws
16 556.22(documents.   The  DocumentKit  class  has  not  yet  been  implemented,  so  for  now) 23 412 ws
16 542.48(we  describe  several  objects  that  can  be  useful  for  building  document  editors  in) 24 412 ws
16 528.74(conjunction  with  the  LayoutKit  objects.) 8 206.993 ws
26.668 514.1(A  ) 2 38.508 ws
12 /Times-Italic sf
38.508 514.1(discretionary) 13 102.504 as
12 /Times-Roman sf
102.504 514.1(  can  take  on  one  of  several  appearances  depending  on  whether  a) 22 412 ws
16 500.36(break  occurs  on  it.   A  common  use  of  a  discretionary  is  for  white  space  in  a  line  of) 35 412 ws
16 486.62(text,  where  the  white  space  becomes  zero-width  glue  if  a  break  occurs  on  the) 26 412 ws
16 472.88(discretionary.   The  penalty  associated  with  a  discretionary  defines  the  relative  cost) 21 412 ws
16 459.14(of  breaking.   Currently,  operations  to  create  discretionaries  are  defined  on  the) 21 412 ws
16 445.4(LayoutKit.) 10 68.332 as
26.668 430.76(An  ) 2 46.0445 ws
12 /Times-Italic sf
46.0445 430.76(lr-marker) 9 92.7005 as
12 /Times-Roman sf
92.7005 430.76(  is  a  glyph  that  can  mark  a  region  of  its  body.   The  marking  is) 29 412 ws
16 417.02(done  by  painting  a  color  under  the  area  or  a  color  on  top  of  the  area  \(or  both\).) 34 412 ws
16 403.28(The  region  is  a  shape  normally  associated  with  text  selections.   The  LRMarker) 23 412 ws
16 389.54(constructor  takes  two  colors,  either  of  which  can  be  nil  if  the  associated  underlay) 26 412 ws
16 375.8(or  overlay  drawing  is  not  desired.   LRMarker::mark  paints  the  given  region.   If  y1) 26 412 ws
16 362.06(and  y2  are  the  same,  then  the  mark  region  is  a  single  rectangle.   Otherwise,  the) 29 412 ws
16 348.32(region  is  defined  as  starting  at  \(x1,y1\)  and  filling  a  height  of  h1  to  \(x1,right\(\)\),) 28 412 ws
16 334.58(then  filling  \(left\(\),y1+h1\)  to  \(right\(\),y2\)  and  filling  a  height  of  h2  from  \(left\(\),y2\)) 24 412 ws
16 320.84(to  \(x2,y2\).   LRMarker::unmark  restores  the  area  to  its  unmarked  appearance.   An) 22 412 ws
12 /Times-Italic sf
16 307.1(xy-marker) 9 65.308 as
12 /Times-Roman sf
65.308 307.1(  is  simliar  to  an  lr-marker,  but  it  only  paints  a  rectangular  area.   While) 27 412 ws
16 293.36(an  lr-marker  is  most  useful  for  selecting  text,  xy-markers  are  useful  for  selecting) 24 412 ws
16 279.62(an  item  in  a  list  or  table.   Figure  12.1  shows  the  LRMarker  and  XYMarker  class) 29 412 ws
16 265.88(interfaces.) 11 65.644 as
18 /Times-Bold sf
16 224.6(12.1) 4 47.5 as
51 224.6(Compositions) 12 156.012 as
12 /Times-Roman sf
16 192.2(A  ) 2 30 ws
12 /Times-Italic sf
30 192.2(composition) 11 88.668 as
12 /Times-Roman sf
88.668 192.2(  is  a  glyph  that  uses  a  ) 14 210.68 ws
12 /Times-Italic sf
210.68 192.2(compositor) 10 264.68 as
12 /Times-Roman sf
264.68 192.2(  to  determine  suitable  breaks) 8 412 ws
16 178.46(between  groups  of  its  components.   Figure  12.2  shows  the  class  interfaces  for  the) 25 412 ws
16 164.72(composition  and  its  subclasses.   The  list  of  components  is  broken  into  sublists) 23 412 ws
16 150.98(that  are  put  into  separate  composite  glyphs  and  then  inserted  into  the  body.) 24 412 ws
16 137.24(The  LRComposition  subclass  uses  LayoutKit::hbox_first_aligned  to  create  each) 14 412 ws
16 123.5(sublist,  while  the  TBComposition  subclass  uses  LayoutKit::vbox_first_aligned.) 12 397.348 ws
26.668 108.86(Compositions  can  be  used  to  break  paragraphs  into  lines,  lines  into  columns,) 22 412 ws
16 95.1201(or  columns  into  pages.   A  document  editor  might  create  an  lr-composition  for) 23 412 ws
16 81.3801(characters  that  puts  the  resulting  hboxes  for  lines  into  a  tb-composition,  which  in) 24 412 ws
16 67.6401(turn  puts  the  vboxes  for  columns  into  an  lr-composition,  which  puts  the  resulting) 24 412 ws
388.72 36.08(12-) 3 404.716 as
407.716 36.08(1) 1 413.716 as
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 467.29(lr-boxes  for  pages  into  a  deck.) 10 161.298 ws
26.668 452.65(Compositions  also  can  be  used  just  as  easily  for  arranging  buttons  in  a  box,) 26 412 ws
16 438.91(where  one  wants  the  buttons  to  ``wrap-around''  if  there  are  too  many  to  fit) 26 412 ws
16 425.17(horizontally.   The  code  to  do  this  could  look  as  follows:) 19 282.821 ws
10 /Helvetica sf
40.99 399.97(LRComposition*  c  =  new  LRComposition\() 8 225.211 ws
49.32 388.45(layout.vbox\(\),  new  SimpleCompositor,  /*  no  separator  */  nil,  /*  width  */  4*72.0) 22 387.79 ws
40.99 376.93(\);) 2 47.1 as
40.99 365.41(Discretionary*  ok  =  layout.discretionary\(0,  nil,  nil,  nil,  nil\);) 14 291.341 ws
40.99 353.89(for  \(unsigned  int  i  =  0;  i  <  nbuttons;  i++\)  {) 20 221.102 ws
49.32 342.37(c->append\(button[i]\);) 21 141.87 as
49.32 330.85(c->append\(ok\);) 14 116.85 as
40.99 319.33(}) 1 44.33 as
40.99 307.81(c->repair\(\);) 12 90.16 as
16 295.33(  ) 2 18.7804 ws
12 /Times-Roman sf
26.668 280.69(The  composition  constructor  takes  a  body  in  which  to  insert  sublists,  a) 22 412 ws
16 266.95(compositor  to  determine  where  to  break,  a  separator  to  be  inserted  at  each  break) 26 412 ws
16 253.21(\(unless  it  is  nil\),  the  dimension  to  use,  the  width  in  which  the  sublists  must  fit,) 30 412 ws
16 239.47(and  optionally  the  initial  size  of  the  list  of  components.   The  initial  size  is  not) 29 412 ws
16 225.73(a  maximum,  but  the  list  by  default  starts  at  a  small  size  and  is  dynamically) 28 412 ws
16 211.99(reallocated  as  needed.   For  large  lists,  it  can  be  more  efficient  to  specify  an) 27 412 ws
16 198.25(estimate  of  the  list  size.   Composition::repair  updates  the  composition  to  reflect) 21 412 ws
16 184.51(changes  to  its  structure.   Composition::item  returns  the  index  of  the  sublist  \(in) 23 412 ws
16 170.77(other  words,  the  component  of  the  body\)  containing  the  component  specified  by) 22 412 ws
16 157.03(the  given  index.   For  example,  this  function  could  be  used  to  return  the  line  that) 29 412 ws
16 143.29(contains  a  particular  character.   Composition::beginning_of  returns  the  index  of) 17 412 ws
16 129.55(the  component  that  starts  the  sublist  specified  by  the  given  item.   For  example,) 25 412 ws
16 115.81(this  function  could  be  used  to  return  the  character  that  starts  a  particular  line.) 26 412 ws
16 102.07(Composition::end_of  is  like  beginning_of  except  it  returns  the  end  of  the  sublist.) 22 412 ws
16 88.33(Composition::margin  causes  space  to  be  left  at  the  beginning  and  end  of  the) 24 412 ws
16 74.59(specified  item  in  the  body.   For  example,  this  function  could  be  used  to  put) 27 412 ws
16 60.85(margins  on  a  line  of  text.  Composition::view  guarantees  that  breaks  are  computed) 22 412 ws
388.72 36.08(12-) 3 404.716 as
407.716 36.08(2) 1 413.716 as
newpath
16 679.66 moveto
16 680.66 lineto
412 680.66 lineto
412 679.66 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.336 663.1(interface  LRMarker  :  MonoGlyph  {) 8 187.947 ws
45.666 651.58(LRMarker\(Glyph*,  Color*  overlay,  Color*  underlay\);) 8 271.826 ws
45.666 640.06(void  mark\() 2 92.3363 ws
53.996 628.54(Coord  left,  Coord  right,  Coord  x1,  Coord  y1,) 14 247.407 ws
53.996 617.02(Coord  h1,  Coord  x2,  Coord  y2,  Coord  h2) 14 234.077 ws
45.666 605.5(\);) 2 51.776 as
45.666 593.98(void  unmark\(\);) 2 109.566 ws
37.336 582.46(};) 2 43.456 as
37.336 559.42(interface  XYMarker  :  MonoGlyph  {) 8 188.507 ws
45.666 547.9(XYMarker\(Glyph*,  Color*  overlay,  Color*  underlay\);) 8 272.386 ws
45.666 536.38(void  mark\(Coord  left,  Coord  bottom,  Coord  right,  Coord  top\);) 16 312.427 ws
45.666 524.86(void  unmark\(\);) 2 109.566 ws
37.336 513.34(};  ) 2 46.2363 ws
10 /Helvetica sf
109.526 496.82(Figure  12.1:) 2 162.886 ws
171.216 496.82(LRMarker  and  XYMarker  protocols) 6 325.146 ws
newpath
16 488.65 moveto
16 489.65 lineto
412 489.65 lineto
412 488.65 lineto
closepath
gsave eofill grestore
showpage
%%Page: 3 3
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 339.61(for  the  components  between  indices  ) 10 206.643 ws
12 /Times-Italic sf
206.643 339.61(first) 5 225.987 as
12 /Times-Roman sf
225.987 339.61(  and  ) 4 255.32 ws
12 /Times-Italic sf
255.32 339.61(last) 4 272.66 as
12 /Times-Roman sf
272.66 339.61(  inclusively.   By  restricting) 7 412 ws
16 325.87(the  viewing  area,  this  operation  can  eliminate  the  computation  of  breaks  for) 22 412 ws
16 312.13(components  that  are  not  visible.) 8 168.989 ws
26.668 297.49(A  compositor  computes  the  breaks  based  on  assessing  the  penalty  for  a  possible) 24 412 ws
16 283.75(breaks.   Three  subclasses  are  provided  that  use  different  levels  of  sophistication  in) 23 412 ws
16 270.01(determining  breaks.   An  ) 7 143.041 ws
12 /Times-Italic sf
143.041 270.01(array-compositor) 16 227.701 as
12 /Times-Roman sf
227.701 270.01(  positions  breaks  every  N  elements,) 10 412 ws
16 256.27(where  N  is  specified  in  the  constructor.   A  ) 17 244.022 ws
12 /Times-Italic sf
244.022 256.27(simple-compositor) 17 333.35 as
12 /Times-Roman sf
333.35 256.27(  finds  a  simple) 6 412 ws
16 242.53(set  of  breaks  quickly.   It   is  analogous  to  a  line-at-a-time  text  formatter.   A) 27 412 ws
12 /Times-Italic sf
16 228.79(TeX-compositor) 14 93.328 as
12 /Times-Roman sf
93.328 228.79(  finds  breaks  using  Knuth's  TeX  algorithm.) 12 302.309 ws
26.668 214.15(Figure  12.3  shows  the  interfaces  to  the  compositor  classes.) 16 412 ws
16 200.41(Compositor::compose  uses  the  natural,  stretch,  shrink,  penalty,  and  span) 16 412 ws
16 186.67(information  for  each  component  as  input  parameters.   The  return  value  is  the) 23 412 ws
16 172.93(number  of  breaks  found.   The  ) 11 168.444 ws
10 /Helvetica sf
168.444 172.93(breaks) 6 198.454 as
12 /Times-Roman sf
198.454 172.93(  array  contains  the  positions  of  the  breaks;) 14 412 ws
16 159.19(that  is,  ) 4 51.0041 ws
10 /Helvetica sf
51.0041 159.19(break[i]) 8 83.7941 as
12 /Times-Roman sf
83.7941 159.19(  is  the  index  of  the  component  where  the  ) 18 282.095 ws
12 /Times-Italic sf
282.095 159.19(i) 1 285.431 as
12 /Times-Roman sf
285.431 159.19(th  break  occurs.) 4 361.739 ws
388.72 36.08(12-) 3 404.716 as
407.716 36.08(3) 1 413.716 as
newpath
15.0399 678.7 moveto
15.0399 679.7 lineto
411.04 679.7 lineto
411.04 678.7 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
36.3759 662.14(interface  Composition  :  MonoGlyph  {) 8 198.667 ws
44.7059 650.62(Composition\() 12 103.606 as
53.0359 639.1(Glyph*,  Compositor*,  Glyph*  separator,  DimensionName,) 8 306.446 ws
53.0359 627.58(Coord  width,  GlyphIndex  size) 6 183.087 ws
44.7059 616.06(\);) 2 50.8159 as
44.7059 604.54(void  repair\(\);) 2 100.826 ws
44.7059 593.02(GlyphIndex  item\(GlyphIndex\);) 2 176.976 ws
44.7059 581.5(lyphIndex  beginning_of\(GlyphIndex\);) 2 207.566 ws
44.7059 569.98(GlyphIndex  end_of\(GlyphIndex\);) 2 188.666 ws
44.7059 558.46(void  margin\(GlyphIndex,  Coord  begin,  Coord  end\);) 10 268.687 ws
44.7059 546.94(void  view\(GlyphIndex  first,  GlyphIndex  last\);) 8 239.217 ws
36.3759 535.42(};) 2 42.4959 as
36.3759 512.38(interface  LRComposition  :  Composition  {) 8 215.887 ws
44.7059 500.86(LRComposition\() 14 116.386 as
53.0359 489.34(Glyph*,  Compositor*,  Glyph*  sep,  Coord,  GlyphIndex  =  10) 14 309.537 ws
44.7059 477.82(\);) 2 50.8159 as
36.3759 466.3(};) 2 42.4959 as
36.3759 443.26(interface  TBComposition  :  Composition  {) 8 215.887 ws
44.7059 431.74(TBComposition\() 14 116.386 as
53.0359 420.22(Glyph*,  Compositor*,  Glyph*  sep,  Coord,  GlyphIndex  =  10) 14 309.537 ws
44.7059 408.7(\);) 2 50.8159 as
36.3759 397.18(};  ) 2 45.2763 ws
10 /Helvetica sf
139.686 380.66(Figure  12.2:) 2 193.046 ws
201.376 380.66(Composition  classes) 2 293.066 ws
10 /Helvetica sf
393.596 364.14(  ) 2 396.376 ws
newpath
15.0399 360.97 moveto
15.0399 361.97 lineto
411.04 361.97 lineto
411.04 360.97 lineto
closepath
gsave eofill grestore
showpage
%%Page: 4 4
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 387.61(See  iv/src/examples/preview.) 2 156.64 ws
388.72 36.08(12-) 3 404.716 as
407.716 36.08(4) 1 413.716 as
newpath
14.08 669.1 moveto
14.08 670.1 lineto
410.08 670.1 lineto
410.08 669.1 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
35.416 652.54(interface  Compositor  {) 4 133.787 ws
43.746 641.02(virtual  int  compose\() 4 130.437 ws
52.076 629.5(Coord*  natural,  Coord*  stretch,  Coord*  shrink,) 10 254.927 ws
52.076 617.98(int*  penalties,  int  component_count,) 6 210.497 ws
52.076 606.46(Coord*  spans,  int  span_count,) 6 186.037 ws
52.076 594.94(int*  breaks,  int  break_count) 6 173.247 ws
43.746 583.42(\);) 2 49.856 as
35.416 571.9(};) 2 41.536 as
35.416 548.86(interface  ArrayCompositor  :  Compositor  {) 8 217.137 ws
43.746 537.34(ArrayCompositor\(int  N\);) 2 148.756 ws
35.416 525.82(};) 2 41.536 as
35.416 502.78(interface  SimpleCompositor  :  Compositor  {) 8 223.807 ws
43.746 491.26(SimpleCompositor\(\);) 19 134.866 as
35.416 479.74(};) 2 41.536 as
35.416 456.7(interface  TeXCompositor  :  Compositor  {) 8 211.587 ws
52.076 445.18(TeXCompositor\(int  penalty\);) 2 176.556 ws
35.416 433.66(};  ) 2 44.3164 ws
10 /Helvetica sf
140.951 417.14(Figure  12.3:) 2 194.311 ws
202.641 417.14(Compositor  classes) 2 289.881 ws
newpath
14.08 408.97 moveto
14.08 409.97 lineto
410.08 409.97 lineto
410.08 408.97 lineto
closepath
gsave eofill grestore
showpage
%%Trailer
end restore
%%Pages: 4
%!PS-Adobe-2.0
%%Creator: ./appA.doc
%%Pages: atend
%%EndComments
save 20 dict begin

/sf {   % scale /fontName => -  (set current font)
    {findfont} stopped {pop /Courier findfont} if
    exch scalefont setfont
} def

/ws {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 8#40 4 3 roll
    widthshow
} def

/as {
    4 index 6 4 roll moveto sub
    2 index stringwidth pop sub
    exch div 0 3 2 roll
    ashow
} def

%%EndProlog
%%Page: 1 1
90.05 36.94 translate
0 0 0 setrgbcolor
24 /Times-Bold sf
16 662.72(Appendix  A) 2 139.361 ws
16 625.76(Operating  System  Interface) 4 299.945 ws
12 /Times-Roman sf
16 597.44(This  appendix  describes  the  classes  that  abstract  operating  system  services.   These) 21 412 ws
16 583.7(classes  do  not  yet  cover  the  entire  range  of  operating  system  operations,  but  they) 26 412 ws
16 569.96(offer  higher-level  abstractions  in  some  cases,  relief  from  name  space  concerns  in) 22 412 ws
16 556.22(other  cases,  and  greater  application  portability.) 10 240.953 ws
26.668 541.58(The  classes  are  presented  below  in  alphabetical  order.   A  ) 19 323.901 ws
12 /Times-Italic sf
323.901 541.58(directory) 9 367.893 as
12 /Times-Roman sf
367.893 541.58(  is  a  list) 6 412 ws
16 527.84(of  files  or  other  directories.   A  file  is  a  list  of  bytes.   Both  directories  and) 30 412 ws
16 514.1(files  are  accessed  by  a  string  name.   A  ) 17 219.437 ws
12 /Times-Italic sf
219.437 514.1(list) 4 234.113 as
12 /Times-Roman sf
234.113 514.1(  is  an  ordered  sequence  of  objects,) 12 412 ws
16 500.36(parameterized  by  the  element  type.   The  math  class  provides  an  interface  to) 23 412 ws
16 486.62(common  mathematical  operations  on  concrete  types  \(e.g.,  ints  and  floats\).   The) 21 412 ws
16 472.88(memory  class  provides  operations  on  variable-length  arrays  of  bytes.   A  ) 21 364.41 ws
12 /Times-Italic sf
364.41 472.88(string) 6 392.418 as
12 /Times-Roman sf
392.418 472.88(  is  a) 4 412 ws
16 459.14(variable-length  list  of  characters.   A  ) 11 190.971 ws
12 /Times-Italic sf
190.971 459.14(table) 5 214.971 as
12 /Times-Roman sf
214.971 459.14(  is  an  associative  map  from  a  key  type  to) 18 412 ws
16 445.4(a  data  type.) 4 70.9848 ws
26.668 430.76(List  and  table  are  generic  classes,  parameterized  by  other  types.   Because) 21 412 ws
16 417.02(few  C++  implementations  currently  support  a  generic  mechanism  \(though  the) 18 412 ws
16 403.28(language  defines  a  template  construct\),  it  is  necessary  to  define  list  and  table) 24 412 ws
16 389.54(classes  using  preprocessor  macros  and  must  be  instantiated  explicitly.) 16 350.957 ws
18 /Times-Bold sf
16 348.26(A.1) 3 42.496 as
51 348.26(Directory) 9 124.962 as
12 /Times-Roman sf
16 315.86(Figure  A.1  shows  the  directory  class  interface.   The  static  member  functions) 21 412 ws
16 302.12(Directory::current  and  Directory::open  return  a  pointer  to  a  Directory.) 16 412 ws
16 288.38(Directory::current  looks  in  the  default  directory  for  the  application  context,) 18 412 ws
16 274.64(Directory::open  tries  to  find  the  directory  with  the  given  name.   If  the  name  cannot) 27 412 ws
16 260.9(be  found  or  access  is  denied  to  the  directory,  Director::open  returns  nil.) 22 358.265 ws
393.84 36.24(A-) 2 406.5 as
409.5 36.24(1) 1 415.5 as
newpath
17.2 236.38 moveto
17.2 237.38 lineto
413.2 237.38 lineto
413.2 236.38 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.536 219.82(interface  Directory  {) 4 125.787 ws
46.866 208.3(static  Directory*  current\(\);) 4 160.217 ws
46.866 196.78(static  Directory*  open\(const  String&\);) 6 210.807 ws
46.866 185.26(int  count\(\)  const;) 4 120.787 ws
46.866 173.74(const  char*  name\(int  i\)  const;) 8 176.357 ws
46.866 162.22(int  index\(const  char*\)  const;) 6 170.247 ws
46.866 150.7(boolean  is_directory\(int  index\)  const;) 6 209.707 ws
46.866 139.18(void  close\(\);) 2 100.766 ws
46.866 127.66(static  String*  canonical\(const  String&\);) 6 216.927 ws
46.866 116.14(static  boolean  match\(const  String&  name,  const  String&  pattern\);) 14 334.216 ws
38.536 104.62(};) 2 44.656 as
10 /Helvetica sf
135.181 88.1(Figure  A.1:) 2 184.091 ws
192.421 88.1(Directory  class  interface.) 4 301.891 ws
newpath
17.2 79.93 moveto
17.2 80.93 lineto
413.2 80.93 lineto
413.2 79.93 lineto
closepath
gsave eofill grestore
showpage
%%Page: 2 2
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
26.668 671.36(Directory::count  returns  the  number  of  entries  \(files  and  directories\),  including) 18 412 ws
16 657.62(any  special  system  entries  such  as  \252.\272  and  \252..\272  on  Unix.   Directory::name  returns) 25 412 ws
16 643.88(the  name  of  the  specified  entry.   Directory::index  returns  the  index  of  the  entry) 25 412 ws
16 630.14(that  matches  the  given  name  or  -1  if  no  match  is  found.   Directory::close  discards) 27 412 ws
16 616.4(the  information  associated  with  the  directory.) 10 233.969 ws
18 /Times-Bold sf
16 575.12(A.2) 3 42.496 as
51 575.12(File) 4 79.998 as
12 /Times-Roman sf
16 542.72(Figure  A.2  shows  the  file  class  interface  and  subclasses  for  input  handling.   The) 25 412 ws
16 528.98(base  class  File  is  abstract  and  defines  no  data  access  functions.   Currently,  only) 25 412 ws
16 515.24(input  files  are  implemented.   File::name  returns  the  string  name  of  the  file.) 23 412 ws
16 501.5(File::length  returns  the  number  of  bytes  in  the  file.   File::close  releases  any) 23 412 ws
16 487.76(information  associated  with  the  file.) 8 188.981 ws
26.668 473.12(File::limit  sets  an  upper  bound  on  the  size  of  a  buffer  to  allocate  for  file  storage.) 30 412 ws
16 459.38(By  default,  a  file  attempts  to  allocate  contiguous  storage  for  its  entire  contents.) 24 412 ws
16 445.64(This  approach  can  allow  for  simpler  application  code  and  can  be  implemented) 22 412 ws
16 431.9(very  efficiently  on  systems  with  memory-mapped  files.) 12 281.633 ws
26.668 417.26(The  contents  of  an  input  file  can  be  accessed  but  not  modified.   InputFile::open) 25 412 ws
16 403.52(returns  nil  if  the  named  file  cannot  be  found  or  is  not  readable.   InputFile::read) 27 412 ws
16 389.78(allocates  a  data  area  for  the  file  contents,  sets  the  start  parameter  to  the  beginning) 28 412 ws
16 376.04(of  the  area,  and  returns  the  length  of  the  area.   If  no  storage  limit  has  been) 31 412 ws
16 362.3(specified  and  the  file  is  on  disk  \(as  opposed  to  a  terminal  or  pipe\),  then  read  will) 32 412 ws
16 348.56(return  the  entire  file.) 6 114.641 ws
18 /Times-Bold sf
16 307.28(A.3) 3 42.496 as
51 307.28(List) 4 81.006 as
12 /Times-Roman sf
16 274.88(Figure  A.3  shows  the  list  generic  class  interfaces.   The  implementation  of  lists) 23 412 ws
16 261.14(uses  a  dynamic  array  with  an  insertion  gap,  meaning  that  large  lists  are  very) 26 412 ws
393.84 36.24(A-) 2 406.5 as
409.5 36.24(2) 1 415.5 as
newpath
18.16 234.46 moveto
18.16 235.46 lineto
414.16 235.46 lineto
414.16 234.46 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
39.496 217.9(interface  File  {) 4 102.857 ws
47.826 206.38(const  char*  name\(\)  const;) 6 161.757 ws
47.826 194.86(long  length\(\)  const;) 4 132.867 ws
47.826 183.34(void  close\(\);) 2 101.726 ws
47.826 166.82(void  limit\(unsigned  int  buffersize\);) 6 196.207 ws
39.496 155.3(};) 2 45.616 as
39.496 138.78(interface  InputFile  :  File  {) 8 149.547 ws
47.826 127.26(static  InputFile*  open\(const  char*  name\);) 8 228.457 ws
47.826 115.74(int  read\(const  char*&  start\);) 6 169.537 ws
39.496 104.22(};) 2 45.616 as
10 /Helvetica sf
148.636 87.7(Figure  A.2:) 2 197.546 ws
205.876 87.7(InputFile  protocols.) 2 290.356 ws
newpath
18.16 79.53 moveto
18.16 80.53 lineto
414.16 80.53 lineto
414.16 79.53 lineto
closepath
gsave eofill grestore
showpage
%%Page: 3 3
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 265.89(space-efficient.   The  time  efficiency  depends  on  the  distribution  of  insertions\261if) 19 412 ws
16 252.15(the  insertion  position  moves  frequently,  the  list  will  do  excessive  copying.) 20 372.653 ws
26.668 237.51(The  list  constructor  takes  an  optional  initial  size  for  the  dynamic  array.   For  lists) 27 412 ws
16 223.77(that  are  known  to  be  large,  specifying  an  initial  size  avoids  the  cost  of  growing  the) 30 412 ws
16 210.03(array  dynamically.   List::count  returns  the  number  of  elements  in  the  list  \(not  the) 25 412 ws
16 196.29(size  of  the  array\).   List::item  returns  the  indexed  item.) 17 273.461 ws
26.668 181.65(List::prepend  adds  an  item  at  the  beginning  of  the  list,  List::append  at  the  end,) 26 412 ws
16 167.91(and  List::insert  before  an  indexed  item.   List::remove  deletes  the  item  specified  by) 23 412 ws
16 154.17(the  given  index.   List::remove_all  deletes  all  the  items  in  the  list.) 21 325.493 ws
26.668 139.53(ListItr  is  a  class  for  iterating  through  the  elements  of  a  list,  parameterized) 24 412 ws
16 125.79(explicitly  by  the  list  type  and  implicitly  by  the  element  type.   The  constructor  is) 27 412 ws
16 112.05(given  the  target  list.   ListItr::more  returns  true  if  additional  elements  are  available) 23 412 ws
16 98.3099(in  the  iteration.   ListItr::cur  returns  the  current  iteration's  item.   ListItr::cur_ref) 20 412 ws
16 84.5699(returns  a  reference  to  the  item.   ListItr::remove_cur  deletes  the  current  item) 21 412 ws
16 70.8299(from  the  list.   ListItr::next  moves  the  iteration  to  the  next  item  in  the  list.   No) 30 412 ws
393.84 36.24(A-) 2 406.5 as
409.5 36.24(3) 1 415.5 as
newpath
17.2 641.5 moveto
17.2 642.5 lineto
413.2 642.5 lineto
413.2 641.5 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
38.536 624.94(interface  List\(T\)  {) 4 114.117 ws
46.866 613.42(List\(T\)\(long  initial_size  =  0\);) 6 169.397 ws
46.866 596.9(long  count\(\)  const;) 4 129.127 ws
46.866 585.38(T  item\(long  index\)  const;) 6 156.347 ws
46.866 573.86(T&  item_ref\(long  index\)  const;) 6 180.247 ws
46.866 562.34(void  prepend\(const  T&\);) 4 153.577 ws
46.866 550.82(void  append\(const  T&\);) 4 150.247 ws
46.866 539.3(void  insert\(long  index,  const  T&\);) 8 192.477 ws
46.866 527.78(void  remove\(long  index\);) 4 156.347 ws
46.866 516.26(void  remove_all\(\);) 2 126.326 ws
38.536 504.74(};) 2 44.656 as
38.536 488.22(interface  ListItr\(ListType\)  {) 4 154.687 ws
46.866 476.7(ListItr\(ListType\)\)\(const  ListType&\);) 2 199.676 ws
46.866 460.18(boolean  more\(\)  const;) 4 144.127 ws
46.866 448.66(T  cur\(\)  const;) 4 105.767 ws
46.866 437.14(T&  cur_ref\(\)  const;) 4 129.667 ws
46.866 425.62(void  next\(\);) 2 96.3264 ws
38.536 414.1(};) 2 44.656 as
38.536 397.58(interface  ListUpdater\(ListType\)  {) 4 181.366 ws
46.866 386.06(ListUpdater\(ListType\)\(ListType&\);) 33 196.346 as
46.866 369.54(boolean  more\(\)  const;) 4 144.127 ws
46.866 358.02(T  cur\(\)  const;) 4 105.767 ws
46.866 346.5(T&  cur_ref\(\)  const;) 4 129.667 ws
46.866 334.98(void  remove_cur\(\);) 2 130.216 ws
46.866 323.46(void  next\(\);) 2 96.3264 ws
38.536 311.94(};) 2 44.656 as
10 /Helvetica sf
118.221 295.42(Figure  A.3:) 2 167.131 ws
175.461 295.42(List  and  iterator  class  interfaces.) 8 318.851 ws
newpath
17.2 287.25 moveto
17.2 288.25 lineto
413.2 288.25 lineto
413.2 287.25 lineto
closepath
gsave eofill grestore
showpage
%%Page: 4 4
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 671.36(modifications  should  be  made  to  the  list  during  an  iteration  \(except  in  the  last) 26 412 ws
16 657.62(step\),  as  this  may  cause  unexpected  or  erroneous  results.) 16 287.273 ws
26.668 642.98(As  an  example,  consider  a  list  of  pointers  to  glyphs.   We  could  declare  such  a) 29 412 ws
16 629.24(list  in  a  header  or  source  file  as  follows:) 16 207.966 ws
37.336 609.8(declarePtrList\(GlyphList,Glyph\)) 31 194.32 as
16 590.36(Only  one  source  file  may  contain  the  expansion  of  the  implementation:) 20 357.293 ws
37.336 570.92(implementPtrList\(GlyphList,Glyph\)) 33 211.012 as
16 551.48(A  loop  to  iterate  over  all  the  glyphs  in  a  list  could  be  written  as  follows:) 30 360.977 ws
37.336 532.04(for  \(ListItr\(GlyphList\)  i\(list\);  i.more\(\);  i.next\(\)\)  {) 10 273.401 ws
48.004 518.6(Glyph*  g  =  i.cur\(\);) 6 138.761 ws
48.004 505.16(//  do  something  with  g) 8 156.017 ws
37.336 491.72(}) 1 43.096 as
26.668 472.28(A  list  makes  no  assumptions  about  its  element  type.   In  particular,  destroying  a) 25 412 ws
16 458.54(list  of  pointers  will  not  destroy  the  objects  that  are  the  targets  of  the  pointers.) 28 384.964 ws
18 /Times-Bold sf
16 417.26(A.4) 3 42.496 as
51 417.26(Math) 4 92.994 as
12 /Times-Roman sf
16 384.86(Figure  A.4  shows  the  math  class  interface.   One  cannot  create  a  \252math  object\272;  all) 27 412 ws
16 371.12(the  member  functions  are  static.   Math::min  and  Math::max  return  the  minimum) 21 412 ws
16 357.38(and  maximum  of  two  or  four  numbers,  respectively.   For  the  sake  of  brevity  only) 27 412 ws
16 343.64(the  floating  point  definitions  are  shown,  but  Math::min  and  Math::max  are  also) 22 412 ws
16 329.9(defined  for  ints,  longs,  unsigned  ints,  unsigned  longs,  and  doubles.) 18 335.993 ws
26.668 315.26(Math::abs  returns  the  absolute  value  of  a  number.   Math::round  returns  the) 21 412 ws
16 301.52(integer  nearest  to  a  floating  point  value.   Math::equal  compares  two  floating  point) 23 412 ws
16 287.78(numbers  and  returns  whether  they  are  within  a  given  epsilon  \(the  third  parameter\)) 24 412 ws
16 274.04(of  each  other.) 4 81.6408 ws
18 /Times-Bold sf
16 232.76(A.5) 3 42.496 as
51 232.76(Memory) 6 116.97 as
12 /Times-Roman sf
16 200.36(Figure  A.5  shows  the  memory  class  interface.   Like  the  math  class,  the  memory) 25 412 ws
16 186.62(class  consists  solely  of  static  member  functions.   Memory::copy  writes  a  specified) 21 412 ws
16 172.88(number  of  bytes  from  one  memory  location  to  another.   Memory::compare) 19 412 ws
16 159.14(determines  if  a  specified  number  of  bytes  at  one  memory  location  is  identical  to) 26 412 ws
16 145.4(those  at  another  location.   If  so,  Memory::compare  returns  0.   Otherwise,  it  returns) 24 412 ws
16 131.66(a  non-zero  value.   Memory::zero  sets  a  specified  number  of  bytes  to  zero  starting) 25 412 ws
16 117.92(at  a  given  memory  location.) 8 150.317 ws
26.668 103.28(In  certain  circumstances,  memory  operations  are  faster  than  a  loop  over  a  set) 24 412 ws
16 89.54(of  elements.   Memory::zero  and  Memory::copy  are  useful  for  implementing  a) 19 412 ws
16 75.8(dynamic  array,  quickly  clearing  or  copying  data  when  the  array  grows.) 20 355.913 ws
393.84 36.24(A-) 2 406.5 as
409.5 36.24(4) 1 415.5 as
showpage
%%Page: 5 5
90.05 36.94 translate
0 0 0 setrgbcolor
18 /Times-Bold sf
16 467.33(A.6) 3 42.496 as
51 467.33(String) 6 99.006 as
12 /Times-Roman sf
16 434.93(Figure  A.6  shows  the  string  class  interface.   The  purpose  of  the  string  class  is  to) 29 412 ws
16 421.19(provide  a  convenient  set  of  operations  for  manipulating  variable-length  character) 18 412 ws
16 407.45(arrays,  ) 2 51.4501 ws
12 /Times-Italic sf
51.4501 407.45(not) 3 66.7861 as
12 /Times-Roman sf
66.7861 407.45(  to  manage  storage.   The  base  class  does  not  allocate  or  free  any  storage) 27 412 ws
16 393.71(associated  with  the  characters.) 6 161.957 ws
26.668 379.07(Three  string  constructors  are  available.   The  first,  with  no  arguments,  creates  an) 23 412 ws
16 365.33(uninitialized  string  that  should  be  assigned  to  another  string  before  use.   The) 23 412 ws
16 351.59(second,  with  a  character  pointer,  sets  the  string's  data  to  the  given  pointer.   The) 27 412 ws
16 337.85(string's  length  is  computed  from  the  pointer  under  the  assumption  that  the  data) 24 412 ws
16 324.11(is  null-terminated.   The  third  constructor  takes  a  character  pointer  and  explicit) 21 412 ws
16 310.37(length.   It  does  not  assume  the  data  is  null-terminated.) 17 274.145 ws
26.668 295.73(String::string  returns  a  pointer  to  the  character  data,  which  may  not  be) 22 412 ws
16 281.99(null-terminated.   String::length  returns  the  number  of  characters  in  the  string.) 19 412 ws
16 268.25(String::null_terminated  returns  whether  the  string  is  already  known  to  be) 18 412 ws
16 254.51(null-terminated  \(it  does  not  attempt  to  find  a  null\).   String::hash  returns  a  value  for) 27 412 ws
16 240.77(the  string  data  suitable  for  indexing  the  strings  into  a  hash  table.) 22 323.309 ws
26.668 226.13(The  string  class  provides  operators  for  assignment  and  comparison.   The  second) 21 412 ws
16 212.39(operand  for  these  operations  can  be  a  string  or  a  character  pointer.   In  the  latter) 29 412 ws
16 198.65(case,  the  data  is  assumed  to  be  null-terminated.   String::case_insensitive_equal) 17 412 ws
16 184.91(tests  for  equality  ignoring  the  case  of  the  characters  in  the  strings.) 22 331.277 ws
393.84 36.24(A-) 2 406.5 as
409.5 36.24(5) 1 415.5 as
newpath
16.24 677.02 moveto
16.24 678.02 lineto
412.24 678.02 lineto
412.24 677.02 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.576 660.46(interface  Math  {) 4 107.057 ws
45.906 648.94(static  float  min\(float  a,  float  b\);) 10 179.297 ws
45.906 637.42(static  float  max\(float  a,  float  b\);) 10 182.077 ws
45.906 625.9(static  float  min\(float  a,  float  b,  float  c,  float  d\);) 18 244.337 ws
45.906 614.38(static  float  max\(float  a,  float  b,  float  c,  float  d\);) 18 247.117 ws
45.906 597.86(static  int  abs\(int\);) 4 121.487 ws
45.906 586.34(static  long  abs\(long\);) 4 138.167 ws
45.906 574.82(static  double  abs\(double\);) 4 160.407 ws
45.906 563.3(static  int  round\(float\);) 4 139.277 ws
45.906 551.78(static  int  round\(double\);) 4 150.397 ws
45.906 540.26(static  boolean  equal\(float  x,  float  y,  float  e\);) 14 236.007 ws
45.906 528.74(static  boolean  equal\(double  x,  double  y,  double  e\);) 14 269.367 ws
37.576 517.22(};) 2 43.696 as
10 /Helvetica sf
143.106 500.7(Figure  A.4:) 2 192.016 ws
200.346 500.7(Math  class  interface.) 4 292.046 ws
newpath
16.24 492.53 moveto
16.24 493.53 lineto
412.24 493.53 lineto
412.24 492.53 lineto
closepath
gsave eofill grestore
newpath
16.24 155.74 moveto
16.24 156.74 lineto
412.24 156.74 lineto
412.24 155.74 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.576 139.18(interface  Memory  {) 4 120.937 ws
45.906 127.66(static  void  copy\(const  void*,  void*  to,  unsigned  int  nbytes\);) 16 303.247 ws
45.906 116.14(static  int  compare\(const  void*,  const  void*,  unsigned  int  nbytes\);) 16 328.807 ws
45.906 104.62(static  void  zero\(void*,  unsigned  int  nbytes\);) 10 235.987 ws
37.576 93.1(};) 2 43.696 as
10 /Helvetica sf
136.166 76.58(Figure  A.5:) 2 185.076 ws
193.406 76.58(Memory  class  interface.) 4 298.986 ws
newpath
16.24 68.41 moveto
16.24 69.41 lineto
412.24 69.41 lineto
412.24 68.41 lineto
closepath
gsave eofill grestore
showpage
%%Page: 6 6
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
26.668 671.36(The  subscript  operator  allows  access  to  individual  characters.   It  is  an  error  to) 25 412 ws
16 657.62(pass  a  negative  index  or  an  index  greater  than  or  equal  to  the  length  of  the  string.) 32 412 ws
16 643.88(String::substr  returns  a  new  string  representing  the  part  of  the  original  string) 22 412 ws
16 630.14(begining  at  the  ) 6 95.3421 ws
12 /Times-Italic sf
95.3421 630.14(start) 5 117.35 as
12 /Times-Roman sf
117.35 630.14(  parameter  and  continuing  for  ) 10 271.339 ws
12 /Times-Italic sf
271.339 630.14(length) 6 301.339 as
12 /Times-Roman sf
301.339 630.14(  characters.   If  ) 7 377.317 ws
12 /Times-Italic sf
377.317 630.14(start) 5 399.325 as
12 /Times-Roman sf
399.325 630.14(  is) 2 412 ws
16 616.4(negative,  the  beginning  position  is  the  end  of  the  string  offset  by  ) 24 330.003 ws
12 /Times-Italic sf
330.003 616.4(start) 5 352.011 as
12 /Times-Roman sf
352.011 616.4(.   If  ) 5 370.855 ws
12 /Times-Italic sf
370.855 616.4(length) 6 400.855 as
12 /Times-Roman sf
400.855 616.4(  is) 2 412 ws
16 602.66(\2611,  then  the  remainder  of  the  string  is  included.   String::substr  does  not  copy  the) 27 412 ws
16 588.92(data,  it  simply  creates  another  string  that  points  into  the  same  data  as  the  original) 28 412 ws
16 575.18(string.   String::left  and  String::right  are  short-hand  for  accessing  the  beginning  or) 21 412 ws
16 561.44(end  of  a  string.   String::set_to_substr,  String::set_to_left,  and  String::set_to_right) 15 412 ws
16 547.7(are  convenience  for  changing  a  string  to  a  particular  substring  instead  of  creating) 24 412 ws
16 533.96(a  new  string.) 4 77.6568 ws
26.668 519.32(String::search  returns  the  index  of  the  occurrence  of  the  given  character  after) 22 412 ws
393.84 36.24(A-) 2 406.5 as
409.5 36.24(6) 1 415.5 as
newpath
16.24 498.46 moveto
16.24 499.46 lineto
412.24 499.46 lineto
412.24 498.46 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
37.576 481.9(interface  String  {) 4 110.947 ws
45.906 470.38(String\(\);) 9 81.466 as
45.906 458.86(String\(const  char*\);) 2 131.486 ws
45.906 447.34(String\(const  char*,  int  length\);) 6 177.627 ws
45.906 430.82(const  char*  string\(\)  const;) 6 159.277 ws
45.906 419.3(int  length\(\)  const;) 4 122.607 ws
45.906 407.78(boolean  null_terminated\(\)  const;) 4 188.746 ws
45.906 396.26(unsigned  long  hash\(\)  const;) 6 168.747 ws
45.906 379.74(String&  operator  =\(const  String&\);) 6 196.247 ws
45.906 368.22(boolean  operator  ==\(const  String&\)  const;) 8 231.557 ws
45.906 356.7(boolean  operator  !=\(const  String&\)  const;) 8 228.497 ws
45.906 345.18(boolean  operator  >\(const  String&\)  const;) 8 225.717 ws
45.906 333.66(boolean  operator  >=\(const  String&\)  const;) 8 231.557 ws
45.906 322.14(boolean  operator  <\(const  String&\)  const;) 8 225.717 ws
45.906 310.62(boolean  operator  <=\(const  String&\)  const;) 8 231.557 ws
45.906 299.1(boolean  case_insensitive_equal\(const  String&\)  const;) 6 283.236 ws
45.906 282.58(char  operator[]\(int  index\)  const;) 6 184.297 ws
45.906 271.06(String  substr\(int  start,  int  length\)  const;) 10 217.087 ws
45.906 259.54(String  left\(int  length\)  const;) 6 164.847 ws
45.906 248.02(String  right\(int  start\)  const;) 6 163.167 ws
45.906 236.5(void  set_to_substr\(int  start,  int  length\);) 8 215.427 ws
45.906 224.98(void  set_to_left\(int  length\);) 4 163.186 ws
45.906 213.46(void  set_to_right\(int  start\);) 4 161.507 ws
45.906 196.94(int  search\(int  start,  char\)  const;) 8 183.177 ws
45.906 185.42(int  index\(char\)  const;) 4 138.717 ws
45.906 173.9(int  rindex\(char\)  const;) 4 142.047 ws
45.906 157.38(boolean  convert\(int&\)  const;) 4 170.406 ws
45.906 145.86(boolean  convert\(long&\)  const;) 4 178.746 ws
45.906 134.34(boolean  convert\(float&\)  const;) 4 178.746 ws
45.906 122.82(boolean  convert\(double&\)  const;) 4 189.866 ws
37.576 111.3(};) 2 43.696 as
10 /Helvetica sf
141.161 94.7802(Figure  A.6:) 2 190.071 ws
198.401 94.7802(String  class  interface.) 4 293.991 ws
newpath
16.24 86.6101 moveto
16.24 87.6101 lineto
412.24 87.6101 lineto
412.24 86.6101 lineto
closepath
gsave eofill grestore
showpage
%%Page: 7 7
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
16 671.36(the  given  starting  position.   If  the  starting  position  is  negative,  it  is  treated  as  an) 29 412 ws
16 657.62(offset  from  the  end  of  the  string  and  the  search  is  made  right-to-left.   String::index) 27 412 ws
16 643.88(and  String::rindex  are  short-hand  for  searching  from  the  beginning  and  end  of  the) 24 412 ws
16 630.14(string,  respectively.) 2 110.32 ws
26.668 615.5(String::convert  attempts  to  interpret  the  string  as  a  number  and  sets  its) 22 412 ws
16 601.76(parameter  to  the  value.   If  the  conversion  is  successful,  String::convert  returns  true.) 23 412 ws
26.668 587.12(Three  string  subclasses  of  string  are  provided,  all  of  which  have  the  same) 24 412 ws
16 573.38(constructors  and  operations  as  the  base  class.   CopyString  is  a  subclass  that) 23 412 ws
16 559.64(copies  the  string  data  when  constructed  and  frees  the  storage  when  deleted.) 22 412 ws
16 545.9(When  the  copy  is  made,  a  null  is  appended  to  ensure  the  data  is  null-terminated.) 28 412 ws
16 532.16(NullTerminatedString  is  a  subclass  that  guarantees  its  data  is  null-terminated.   If) 21 412 ws
16 518.42(constructed  with  a  normal  string,  it  will  copy  the  data  much  like  a  copy-string.) 26 412 ws
16 504.68(However,  if  the  given  string  is  already  a  copy-string,  then  no  copy  is  made.) 26 412 ws
16 490.94(NullTerminatedString  is  useful  for  passing  string  data  to  external  C  functions,) 20 412 ws
16 477.2(such  as  printf.) 4 83.6568 ws
26.668 462.56(The  third  string  subclass  is  UniqueString,  which  uses  a  table  to  map  identical) 24 412 ws
16 448.82(strings  to  the  same  data.   Comparing  unique  strings  for  equality  is  fast  because  the) 27 412 ws
16 435.08(implementation  can  compare  pointers  instead  of  the  string  data.   Unique  strings) 21 412 ws
16 421.34(are  not  null-terminated.) 4 128.981 ws
18 /Times-Bold sf
16 380.06(A.7) 3 42.496 as
51 380.06(Table) 5 95.01 as
12 /Times-Roman sf
16 347.66(Figure  A.7  shows  the  table  class  interface.   Table  is  a  generic  class  that  is) 27 412 ws
16 333.92(parameterized  by  a  key  type  and  a  value  type.   The  constructor  is  given  a  size  for) 31 412 ws
16 320.18(the  hash  table  implementation.   For  good  access  performance,  the  size  should  be) 23 412 ws
16 306.44(roughly  twice  the  expected  number  of  keys.) 12 226.289 ws
26.668 291.8(Table::insert  stores  a  <key,value>  pair.   Table::find  searches  an  entry  with) 19 412 ws
16 278.06(the  given  key.   If  such  an  entry  exists,  Table::find  sets  ) 21 298.496 ws
12 /Times-Italic sf
298.496 278.06(value) 5 324.488 as
12 /Times-Roman sf
324.488 278.06(  and  returns  true.) 6 412 ws
16 264.32(Otherwise,  it  leaves  the  parameter  unmodified  and  returns  false.   Table::remove) 19 412 ws
16 250.58(deletes  a  <key,value>  pair  from  the  table  if  one  exists.   Table::find_and_remove) 21 412 ws
16 236.84(combines  the  find  and  remove  operations  in  a  single  call.) 18 289.961 ws
26.668 222.2(If  the  same  key  is  inserted  more  than  once,  Table::find  will  return  the  most) 26 412 ws
16 208.46(recently  inserted  value.   Similarly,  Table::remove  will  delete  the  most  recently) 19 412 ws
16 194.72(inserted  pair.) 2 78.6524 ws
26.668 180.08(TableIterator  allows  one  to  iterate  over  all  the  <key,value>  pairs  defined  in  a) 24 412 ws
16 166.34(table.   TableIterator  is  parameterized  explicitly  by  the  table  type,  implicitly  by  the) 23 412 ws
16 152.6(key  and  value  types.   TableIterator::cur_key  and  TableIterator::cur_value  return) 15 412 ws
16 138.86(the  current  entry  information.   TableIterator::more  tests  if  additional  entries  are) 19 412 ws
16 125.12(defined.   TableIterator::next  moves  to  the  next  entry  in  the  table.) 19 324.449 ws
393.84 36.24(A-) 2 406.5 as
409.5 36.24(7) 1 415.5 as
showpage
%%Page: 8 8
90.05 36.94 translate
0 0 0 setrgbcolor
12 /Times-Roman sf
393.84 36.24(A-) 2 406.5 as
409.5 36.24(8) 1 415.5 as
newpath
14.3201 588.7 moveto
14.3201 589.7 lineto
410.32 589.7 lineto
410.32 588.7 lineto
closepath
gsave eofill grestore
10 /Helvetica sf
35.6561 572.14(unsigned  long  key_to_hash\(Key\);) 4 184.066 ws
35.6561 555.62(interface  Table\(Key,Value\)  {) 4 160.157 ws
43.9861 544.1(Table\(Key,Value\)\(int  hash_table_size\);) 2 216.276 ws
43.9861 527.58(void  insert\(Key,  Value\);) 4 147.357 ws
43.9861 516.06(boolean  find\(Value&,  Key\);) 4 162.937 ws
43.9861 504.54(void  remove\(Key\);) 2 125.116 ws
43.9861 493.02(boolean  find_and_remove\(Value&,  Key\);) 4 224.076 ws
35.6561 481.5(};) 2 41.7761 as
35.6561 464.98(interface  TableIterator\(Table\(Key,Value\)\)  {) 4 223.506 ws
43.9861 453.46(TableIterator\(Table\(Key,Value\)\)\(Table\(Key,Value\)&\);) 51 277.946 as
43.9861 436.94(Key&  cur_key\(\);) 2 115.116 ws
43.9861 425.42(Value&  cur_value\(\);) 2 131.796 ws
43.9861 413.9(boolean  more\(\);) 2 114.566 ws
43.9861 402.38(boolean  next\(\);) 2 110.686 ws
35.6561 390.86(};) 2 41.7761 as
10 /Helvetica sf
139.796 374.34(Figure  A.7:) 2 188.706 ws
197.036 374.34(Table  class  interface.) 4 291.516 ws
newpath
14.3201 366.17 moveto
14.3201 367.17 lineto
410.32 367.17 lineto
410.32 366.17 lineto
closepath
gsave eofill grestore
showpage
%%Trailer
end restore
%%Pages: 8
